From 60a45ff394a8184356934767b6afff03959d456b Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Thu, 10 Feb 2022 04:06:02 -0600 Subject: [PATCH] exchange.get_max_leverage de-complex --- freqtrade/exchange/exchange.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 018182502..a99a161b6 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -1935,19 +1935,16 @@ class Exchange: ) if pair not in self._leverage_tiers: - tiers = self.get_leverage_tiers_for_pair(pair) - if not tiers: # Not a leveraged market - return 1.0 - - if stake_amount == 0: - return self._leverage_tiers[pair][0]['lev'] # Max lev for lowest amount + self.get_leverage_tiers_for_pair(pair) pair_tiers = self._leverage_tiers[pair] num_tiers = len(pair_tiers) - if num_tiers < 1: return 1.0 + if stake_amount == 0: + return self._leverage_tiers[pair][0]['lev'] # Max lev for lowest amount + for tier_index in range(num_tiers): tier = pair_tiers[tier_index]