From bf00f93f76057ad8fb352147d8ef626811ddb94c Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 30 Mar 2023 22:42:27 +0800 Subject: [PATCH] grid2: add UpdateZeroOrderFee option --- pkg/strategy/grid2/strategy.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/strategy/grid2/strategy.go b/pkg/strategy/grid2/strategy.go index 71e09e8fb..1494f3426 100644 --- a/pkg/strategy/grid2/strategy.go +++ b/pkg/strategy/grid2/strategy.go @@ -163,6 +163,11 @@ type Strategy struct { // it makes sure that your grid configuration is profitable. FeeRate fixedpoint.Value `json:"feeRate"` + // UpdateZeroOrderFee - this option adds an extra retry when the order fee returns zero + // sometimes the fee is not ready yet, the exchange did not finish the fee calculation. + // and there is a delay between the fee is calculated + UpdateZeroOrderFee bool `json:"updateZeroOrderFee"` + SkipSpreadCheck bool `json:"skipSpreadCheck"` RecoverGridByScanningTrades bool `json:"recoverGridByScanningTrades"` @@ -425,7 +430,7 @@ func (s *Strategy) processFilledOrder(o types.Order) { fee.String(), feeCurrency) // do 1 time retry - if fee.IsZero() || feeCurrency == "" { + if s.UpdateZeroOrderFee && (fee.IsZero() || feeCurrency == "") { time.Sleep(queryOrderTradesRetryDelay) fee, feeCurrency = s.aggregateOrderFee(o)