xfunding: only do transfer when the available balance is not zero

This commit is contained in:
c9s 2023-03-29 21:48:10 +08:00
parent d0566e23ec
commit 866443d89f
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -21,7 +21,11 @@ func (s *Strategy) resetTransfer(ctx context.Context, ex FuturesTransfer, asset
b, ok := balances[asset] b, ok := balances[asset]
if !ok { if !ok {
return fmt.Errorf("%s balance not found", asset) return nil
}
if b.Available.IsZero() {
return nil
} }
log.Infof("transfering out futures account asset %s %s", b.Available, asset) log.Infof("transfering out futures account asset %s %s", b.Available, asset)