exchange._set_leverage rounds leverage

This commit is contained in:
Sam Germain 2022-02-01 22:29:04 -06:00
parent 8a64f6a27f
commit 8e51360f75
3 changed files with 3 additions and 3 deletions

View File

@ -228,7 +228,7 @@ class Binance(Exchange):
return return
try: try:
self._api.set_leverage(symbol=pair, leverage=leverage) self._api.set_leverage(symbol=pair, leverage=round(leverage))
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:

View File

@ -1853,7 +1853,7 @@ class Exchange:
return return
try: try:
self._api.set_leverage(symbol=pair, leverage=leverage) self._api.set_leverage(symbol=pair, leverage=round(leverage))
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:

View File

@ -170,7 +170,7 @@ class Kraken(Exchange):
) -> Dict: ) -> Dict:
params = super()._get_params(ordertype, leverage, reduceOnly, time_in_force) params = super()._get_params(ordertype, leverage, reduceOnly, time_in_force)
if leverage > 1.0: if leverage > 1.0:
params['leverage'] = leverage params['leverage'] = round(leverage)
return params return params
def calculate_funding_fees( def calculate_funding_fees(