From feec194843f5cdfbd7b6ea60a6e2c71ed07127c0 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 24 Mar 2023 14:37:18 +0800 Subject: [PATCH] binance: improve transfer logs --- pkg/exchange/binance/exchange.go | 9 ++++++++- pkg/strategy/xfunding/strategy.go | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/exchange/binance/exchange.go b/pkg/exchange/binance/exchange.go index 9880b6d2d..4e56853b2 100644 --- a/pkg/exchange/binance/exchange.go +++ b/pkg/exchange/binance/exchange.go @@ -381,7 +381,14 @@ func (e *Exchange) TransferFuturesAccountAsset(ctx context.Context, asset string } resp, err := req.Do(ctx) - log.Infof("futures transfer %s %s, transaction = %+v, err = %+v", amount.String(), asset, resp, err) + + switch io { + case types.TransferIn: + log.Infof("internal transfer (spot) => (futures) %s %s, transaction = %+v, err = %+v", amount.String(), asset, resp, err) + case types.TransferOut: + log.Infof("internal transfer (futures) => (spot) %s %s, transaction = %+v, err = %+v", amount.String(), asset, resp, err) + } + return err } diff --git a/pkg/strategy/xfunding/strategy.go b/pkg/strategy/xfunding/strategy.go index 15f29d2ac..77e662d73 100644 --- a/pkg/strategy/xfunding/strategy.go +++ b/pkg/strategy/xfunding/strategy.go @@ -162,6 +162,8 @@ func (s *Strategy) Defaults() error { s.MinHoldingPeriod = types.Duration(3 * 24 * time.Hour) } + s.positionType = types.PositionShort + return nil }