From fe5a6f4c364ffbcf55d071ad5da0be9d3323f086 Mon Sep 17 00:00:00 2001 From: c9s Date: Tue, 13 Jun 2023 12:42:07 +0800 Subject: [PATCH] xalign: fix quote amount check --- pkg/strategy/xalign/strategy.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/strategy/xalign/strategy.go b/pkg/strategy/xalign/strategy.go index 1adc975a1..89fbc6035 100644 --- a/pkg/strategy/xalign/strategy.go +++ b/pkg/strategy/xalign/strategy.go @@ -141,8 +141,8 @@ func (s *Strategy) selectSessionForCurrency(ctx context.Context, sessions map[st requiredQuoteAmount := q.Mul(price) requiredQuoteAmount = requiredQuoteAmount.Round(market.PricePrecision, fixedpoint.Up) - if requiredQuoteAmount.Compare(quoteBalance.Available) < 0 { - log.Warnf("required quote amount %f < quote balance %v", requiredQuoteAmount.Float64(), quoteBalance) + if requiredQuoteAmount.Compare(quoteBalance.Available) > 0 { + log.Warnf("required quote amount %f > quote balance %v, skip", requiredQuoteAmount.Float64(), quoteBalance) continue } @@ -165,7 +165,7 @@ func (s *Strategy) selectSessionForCurrency(ctx context.Context, sessions map[st } if q.Compare(baseBalance.Available) > 0 { - log.Warnf("required base amount %f < available base balance %v", q.Float64(), baseBalance) + log.Warnf("required base amount %f < available base balance %v, skip", q.Float64(), baseBalance) continue }