xdepthmaker: remove price truncation

This commit is contained in:
c9s 2024-11-16 16:46:24 +08:00
parent b2b363ba42
commit 39b2354f08
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -1026,18 +1026,16 @@ func (s *Strategy) generateMakerOrders(
depthPrice = depthPrice.Mul(fixedpoint.One.Sub(s.BidMargin)) depthPrice = depthPrice.Mul(fixedpoint.One.Sub(s.BidMargin))
} }
depthPrice = depthPrice.Round(s.makerMarket.PricePrecision+1, fixedpoint.Down) depthPrice = depthPrice.Round(s.makerMarket.PricePrecision, fixedpoint.Down)
case types.SideTypeSell: case types.SideTypeSell:
if s.AskMargin.Sign() > 0 { if s.AskMargin.Sign() > 0 {
depthPrice = depthPrice.Mul(fixedpoint.One.Add(s.AskMargin)) depthPrice = depthPrice.Mul(fixedpoint.One.Add(s.AskMargin))
} }
depthPrice = depthPrice.Round(s.makerMarket.PricePrecision+1, fixedpoint.Up) depthPrice = depthPrice.Round(s.makerMarket.PricePrecision, fixedpoint.Up)
} }
depthPrice = s.makerMarket.TruncatePrice(depthPrice)
if lastMakerPrice.Sign() > 0 && depthPrice.Compare(lastMakerPrice) == 0 { if lastMakerPrice.Sign() > 0 && depthPrice.Compare(lastMakerPrice) == 0 {
switch side { switch side {
case types.SideTypeBuy: case types.SideTypeBuy: