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:
Matthias
2025-07-05 19:56:52 +02:00
parent 315009a7f0
commit 701cf47c4b

View File

@@ -3434,6 +3434,12 @@ class Exchange:
prior_max_lev = tier["maxLeverage"]
if min_stake <= stake_amount <= max_stake:
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
if stake_amount > max_stake: