exchange.fill_leverage_brackets/get_maintenance_ratio_and_amt docstring and type specification

This commit is contained in:
Sam Germain
2022-01-14 06:11:17 -06:00
parent b4a0611afc
commit bb2b2211d0
8 changed files with 57 additions and 31 deletions

View File

@@ -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)

View File

@@ -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)