From 34d42afbec53a9da55fd3e6810fbe424b6ce2d97 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 16 Jun 2023 17:35:24 +0800 Subject: [PATCH] xfunding: fix syncSpotPosition cancel order issue --- pkg/strategy/xfunding/strategy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/strategy/xfunding/strategy.go b/pkg/strategy/xfunding/strategy.go index 0c24a9991..abe35c9fa 100644 --- a/pkg/strategy/xfunding/strategy.go +++ b/pkg/strategy/xfunding/strategy.go @@ -826,7 +826,7 @@ func (s *Strategy) syncSpotPosition(ctx context.Context) { return } - log.Infof("spot/futures positions: %s (spot) <=> %s (futures)", spotBase.String(), futuresBase.String()) + log.Infof("syncSpotPosition: spot/futures positions: %s (spot) <=> %s (futures)", spotBase.String(), futuresBase.String()) if futuresBase.Sign() > 0 { // unexpected error @@ -834,7 +834,7 @@ func (s *Strategy) syncSpotPosition(ctx context.Context) { return } - _ = s.futuresOrderExecutor.GracefulCancel(ctx) + _ = s.spotOrderExecutor.GracefulCancel(ctx) ticker, err := s.spotSession.Exchange.QueryTicker(ctx, s.Symbol) if err != nil {