Log Exchange responses for set_leverage
This commit is contained in:
parent
46e8d9a5e4
commit
075e9b8526
@ -2377,7 +2377,8 @@ class Exchange:
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
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:
|
except ccxt.DDoSProtection as e:
|
||||||
raise DDosProtection(e) from e
|
raise DDosProtection(e) from e
|
||||||
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
||||||
@ -2441,7 +2442,8 @@ class Exchange:
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
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:
|
except ccxt.DDoSProtection as e:
|
||||||
raise DDosProtection(e) from e
|
raise DDosProtection(e) from e
|
||||||
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
||||||
|
@ -148,7 +148,7 @@ class Wallets:
|
|||||||
# Position is not open ...
|
# Position is not open ...
|
||||||
continue
|
continue
|
||||||
size = self._exchange._contracts_to_amount(symbol, position['contracts'])
|
size = self._exchange._contracts_to_amount(symbol, position['contracts'])
|
||||||
collateral = position['collateral']
|
collateral = position['collateral'] or 0.0
|
||||||
leverage = position['leverage']
|
leverage = position['leverage']
|
||||||
self._positions[symbol] = PositionWallet(
|
self._positions[symbol] = PositionWallet(
|
||||||
symbol, position=size,
|
symbol, position=size,
|
||||||
|
Loading…
Reference in New Issue
Block a user