mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Reduce error severity when maintenance-ratio fails
This commit is contained in:
parent
f419d7870d
commit
13974d2508
|
@ -2900,8 +2900,8 @@ class Exchange:
|
|||
if nominal_value >= tier['minNotional']:
|
||||
return (tier['maintenanceMarginRate'], tier['maintAmt'])
|
||||
|
||||
raise OperationalException("nominal value can not be lower than 0")
|
||||
raise ExchangeError("nominal value can not be lower than 0")
|
||||
# The lowest notional_floor for any pair in fetch_leverage_tiers is always 0 because it
|
||||
# describes the min amt for a tier, and the lowest tier will always go down to 0
|
||||
else:
|
||||
raise OperationalException(f"Cannot get maintenance ratio using {self.name}")
|
||||
raise ExchangeError(f"Cannot get maintenance ratio using {self.name}")
|
||||
|
|
|
@ -4932,7 +4932,7 @@ def test_get_maintenance_ratio_and_amt_exceptions(mocker, default_conf, leverage
|
|||
|
||||
exchange._leverage_tiers = leverage_tiers
|
||||
with pytest.raises(
|
||||
OperationalException,
|
||||
DependencyException,
|
||||
match='nominal value can not be lower than 0',
|
||||
):
|
||||
exchange.get_maintenance_ratio_and_amt('1000SHIB/USDT:USDT', -1)
|
||||
|
|
Loading…
Reference in New Issue
Block a user