xfunding: add e.AccountUpdate.EventReasonType switch case

This commit is contained in:
c9s 2023-03-25 02:48:27 +08:00
parent f34c72eba0
commit 0f49f9fbe5
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -332,9 +332,22 @@ func (s *Strategy) CrossRun(ctx context.Context, orderExecutionRouter bbgo.Order
}
})
s.futuresSession.MarketDataStream.OnKLineClosed(types.KLineWith(s.Symbol, types.Interval1m, func(kline types.KLine) {
// s.queryAndDetectPremiumIndex(ctx, binanceFutures)
}))
// s.futuresSession.MarketDataStream.OnKLineClosed(types.KLineWith(s.Symbol, types.Interval1m, func(kline types.KLine) {}))
if binanceStream, ok := s.futuresSession.UserDataStream.(*binance.Stream); ok {
binanceStream.OnAccountUpdateEvent(func(e *binance.AccountUpdateEvent) {
log.Infof("onAccountUpdateEvent: %+v", e)
switch e.AccountUpdate.EventReasonType {
case binance.AccountUpdateEventReasonDeposit:
case binance.AccountUpdateEventReasonWithdraw:
case binance.AccountUpdateEventReasonFundingFee:
}
})
}
go func() {
ticker := time.NewTicker(10 * time.Second)