From 41ab20d9495251041651f232cad553a6c2fd1a28 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Thu, 10 Feb 2022 03:44:22 -0600 Subject: [PATCH] get_max_leverage checks if the number of tiers is < 1 --- freqtrade/exchange/exchange.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index d46c141df..018182502 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -1931,7 +1931,8 @@ class Exchange: # Checks and edge cases if stake_amount is None: raise OperationalException( - 'binance.get_max_leverage requires argument stake_amount') + f'{self.name}.get_max_leverage requires argument stake_amount' + ) if pair not in self._leverage_tiers: tiers = self.get_leverage_tiers_for_pair(pair) @@ -1944,6 +1945,9 @@ class Exchange: pair_tiers = self._leverage_tiers[pair] num_tiers = len(pair_tiers) + if num_tiers < 1: + return 1.0 + for tier_index in range(num_tiers): tier = pair_tiers[tier_index]