Skip to content

Commit

Permalink
xfunding: add PositionReady case
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Mar 6, 2024
1 parent 256e09a commit b77618f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/strategy/xfunding/strategy.go
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down

0 comments on commit b77618f

Please sign in to comment.