Skip to content

Commit

Permalink
xdepthmaker: remove price truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Nov 16, 2024
1 parent b2b363b commit 39b2354
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/strategy/xdepthmaker/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1026,18 +1026,16 @@ func (s *Strategy) generateMakerOrders(
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:
if s.AskMargin.Sign() > 0 {
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 {
switch side {
case types.SideTypeBuy:
Expand Down

0 comments on commit 39b2354

Please sign in to comment.