From 65da02af2c833c5fa1ad7ab356c71ddcdf0d190b Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 26 Dec 2021 15:45:39 +0800 Subject: [PATCH] xmaker: call TruncateQuantity when the quantity is adjusted --- pkg/strategy/xmaker/strategy.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/strategy/xmaker/strategy.go b/pkg/strategy/xmaker/strategy.go index 47bb41f14..d753d9008 100644 --- a/pkg/strategy/xmaker/strategy.go +++ b/pkg/strategy/xmaker/strategy.go @@ -538,6 +538,7 @@ func (s *Strategy) Hedge(ctx context.Context, pos fixedpoint.Value) { if quote.Available < notional { // adjust price to higher 0.1%, so that we can ensure that the order can be executed quantity = bbgo.AdjustQuantityByMaxAmount(quantity, fixedpoint.NewFromFloat(lastPrice*1.001), quote.Available) + quantity = s.sourceMarket.TruncateQuantity(quantity) } }