diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index dbc3447be..ef5b96096 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -2377,7 +2377,8 @@ class Exchange: return try: - self._api.set_leverage(symbol=pair, leverage=leverage) + res = self._api.set_leverage(symbol=pair, leverage=leverage) + self._log_exchange_response('set_leverage', res) except ccxt.DDoSProtection as e: raise DDosProtection(e) from e except (ccxt.NetworkError, ccxt.ExchangeError) as e: @@ -2441,7 +2442,8 @@ class Exchange: return try: - self._api.set_margin_mode(margin_mode.value, pair, params) + res = self._api.set_margin_mode(margin_mode.value, pair, params) + self._log_exchange_response('set_margin_mode', res) except ccxt.DDoSProtection as e: raise DDosProtection(e) from e except (ccxt.NetworkError, ccxt.ExchangeError) as e: diff --git a/freqtrade/wallets.py b/freqtrade/wallets.py index 14e5a6743..41115c72e 100644 --- a/freqtrade/wallets.py +++ b/freqtrade/wallets.py @@ -148,7 +148,7 @@ class Wallets: # Position is not open ... continue size = self._exchange._contracts_to_amount(symbol, position['contracts']) - collateral = position['collateral'] + collateral = position['collateral'] or 0.0 leverage = position['leverage'] self._positions[symbol] = PositionWallet( symbol, position=size,