From 39b2354f086d70b19fe0f7a2a6a7ac32bafc3f34 Mon Sep 17 00:00:00 2001 From: c9s Date: Sat, 16 Nov 2024 16:46:24 +0800 Subject: [PATCH] xdepthmaker: remove price truncation --- pkg/strategy/xdepthmaker/strategy.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/strategy/xdepthmaker/strategy.go b/pkg/strategy/xdepthmaker/strategy.go index 972a48df7..8b48e4483 100644 --- a/pkg/strategy/xdepthmaker/strategy.go +++ b/pkg/strategy/xdepthmaker/strategy.go @@ -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: