mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-15 20:31:43 +00:00
fix: implement fall-through for leverage tier finding
We'll for now issue a warning about this - and use the "current" tier This way, gaps in tier data (between maxNotional and the next minNotional) no longer cause an operational exception. closes #11923
This commit is contained in:
@@ -3434,6 +3434,12 @@ class Exchange:
|
|||||||
prior_max_lev = tier["maxLeverage"]
|
prior_max_lev = tier["maxLeverage"]
|
||||||
if min_stake <= stake_amount <= max_stake:
|
if min_stake <= stake_amount <= max_stake:
|
||||||
return tier["maxLeverage"]
|
return tier["maxLeverage"]
|
||||||
|
if stake_amount < min_stake and stake_amount <= max_stake:
|
||||||
|
logger.warning(
|
||||||
|
f"Fallback to next higher leverage tier for {pair}, stake: {stake_amount}, "
|
||||||
|
f"min_stake: {min_stake}."
|
||||||
|
)
|
||||||
|
return tier["maxLeverage"]
|
||||||
|
|
||||||
# else: # if on the last tier
|
# else: # if on the last tier
|
||||||
if stake_amount > max_stake:
|
if stake_amount > max_stake:
|
||||||
|
|||||||
Reference in New Issue
Block a user