From e244402c873523243cec51be74d955d258c090f1 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 6 Mar 2024 22:07:00 +0800 Subject: [PATCH] xfunding: add PositionReady case --- pkg/strategy/xfunding/strategy.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/strategy/xfunding/strategy.go b/pkg/strategy/xfunding/strategy.go index aac2908c93..50d1b392bb 100644 --- a/pkg/strategy/xfunding/strategy.go +++ b/pkg/strategy/xfunding/strategy.go @@ -404,10 +404,12 @@ func (s *Strategy) CrossRun( ) } } - + default: } switch s.State.PositionState { + case PositionReady: + case PositionOpening: // transfer all base assets from the spot account into the spot account if err := s.transferIn(ctx, s.binanceSpot, s.spotMarket.BaseCurrency, fixedpoint.Zero); err != nil { @@ -419,6 +421,7 @@ func (s *Strategy) CrossRun( if err := s.transferOut(ctx, s.binanceSpot, s.spotMarket.BaseCurrency, fixedpoint.Zero); err != nil { log.WithError(err).Errorf("futures asset transfer out error") } + } s.spotOrderExecutor = s.allocateOrderExecutor(ctx, s.spotSession, instanceID, s.SpotPosition)