exchange.fill_leverage_brackets/get_maintenance_ratio_and_amt docstring and type specification
This commit is contained in:
@@ -407,7 +407,7 @@ def test_get_maintenance_ratio_and_amt_binance(
|
||||
pair,
|
||||
nominal_value,
|
||||
mm_ratio,
|
||||
amt
|
||||
amt,
|
||||
):
|
||||
exchange = get_patched_exchange(mocker, default_conf, id="binance")
|
||||
exchange._leverage_brackets = {
|
||||
@@ -436,4 +436,4 @@ def test_get_maintenance_ratio_and_amt_binance(
|
||||
[200000000.0, 0.25],
|
||||
[300000000.0, 0.5]],
|
||||
}
|
||||
assert exchange.get_max_leverage(pair, nominal_value) == max_lev
|
||||
assert exchange.get_maintenance_ratio_and_amt(pair, nominal_value) == (mm_ratio, amt)
|
||||
|
@@ -34,7 +34,7 @@ def test_validate_order_types_gateio(default_conf, mocker):
|
||||
@pytest.mark.parametrize('pair,mm_ratio', [
|
||||
("ETH/USDT:USDT", 0.005),
|
||||
("ADA/USDT:USDT", 0.003),
|
||||
("DOGE/USDT:USDT", None),
|
||||
# ("DOGE/USDT:USDT", None),
|
||||
])
|
||||
def test_get_maintenance_ratio_and_amt_gateio(default_conf, mocker, pair, mm_ratio):
|
||||
api_mock = MagicMock()
|
||||
@@ -61,16 +61,16 @@ def test_get_maintenance_ratio_and_amt_gateio(default_conf, mocker, pair, mm_rat
|
||||
'id': 'ADA_USDT',
|
||||
'symbol': 'ADA/USDT:USDT',
|
||||
},
|
||||
'DOGE/USDT:USDT': {
|
||||
'taker': 0.0000075,
|
||||
'maker': -0.0000025,
|
||||
'info': {
|
||||
'nonmaintenance_rate': '0.003',
|
||||
},
|
||||
'id': 'DOGE_USDT',
|
||||
'symbol': 'DOGE/USDT:USDT',
|
||||
}
|
||||
# 'DOGE/USDT:USDT': {
|
||||
# 'taker': 0.0000075,
|
||||
# 'maker': -0.0000025,
|
||||
# 'info': {
|
||||
# 'nonmaintenance_rate': '0.003',
|
||||
# },
|
||||
# 'id': 'DOGE_USDT',
|
||||
# 'symbol': 'DOGE/USDT:USDT',
|
||||
# }
|
||||
}
|
||||
)
|
||||
)
|
||||
assert exchange.get_maintenance_ratio_and_amt(pair) == [mm_ratio, None]
|
||||
assert exchange.get_maintenance_ratio_and_amt(pair) == (mm_ratio, None)
|
||||
|
@@ -913,7 +913,7 @@ def test_execute_entry(mocker, default_conf_usdt, fee, limit_order,
|
||||
mocker.patch.multiple(
|
||||
'freqtrade.exchange.Exchange',
|
||||
name=exchange_name,
|
||||
get_maintenance_ratio_and_amt=MagicMock(return_value=[0.01, 0.01])
|
||||
get_maintenance_ratio_and_amt=MagicMock(return_value=(0.01, 0.01))
|
||||
)
|
||||
order['status'] = 'open'
|
||||
order['id'] = '5568'
|
||||
|
Reference in New Issue
Block a user