test_get_liquidation_price/test_get_maintenance_ratio_and_amt_binance/fill_leverage_brackets/test_validate_trading_mode_and_collateral TODO comments

This commit is contained in:
Sam Germain
2022-01-14 06:58:32 -06:00
parent c2f9201512
commit 1f1ac8ce9d
4 changed files with 87 additions and 74 deletions

View File

@@ -397,9 +397,9 @@ def test__ccxt_config(default_conf, mocker, trading_mode, collateral, config):
("BNB/BUSD", 0.0, 0.025, 0),
("BNB/USDT", 100.0, 0.0065, 0),
("BTC/USDT", 170.30, 0.004, 0),
("BNB/BUSD", 999999.9, 0.1, 0),
("BNB/USDT", 5000000.0, 0.5, 0),
("BTC/USDT", 300000000.1, 0.5, 0),
("BNB/BUSD", 999999.9, 0.1, 27500.0),
("BNB/USDT", 5000000.0, 0.15, 233034.99999999994),
("BTC/USDT", 300000000.1, 0.5, 99891300.0),
])
def test_get_maintenance_ratio_and_amt_binance(
default_conf,
@@ -411,29 +411,30 @@ def test_get_maintenance_ratio_and_amt_binance(
):
exchange = get_patched_exchange(mocker, default_conf, id="binance")
exchange._leverage_brackets = {
'BNB/BUSD': [[0.0, 0.025],
[100000.0, 0.05],
[500000.0, 0.1],
[1000000.0, 0.15],
[2000000.0, 0.25],
[5000000.0, 0.5]],
'BNB/USDT': [[0.0, 0.0065],
[10000.0, 0.01],
[50000.0, 0.02],
[250000.0, 0.05],
[1000000.0, 0.1],
[2000000.0, 0.125],
[5000000.0, 0.15],
[10000000.0, 0.25]],
'BTC/USDT': [[0.0, 0.004],
[50000.0, 0.005],
[250000.0, 0.01],
[1000000.0, 0.025],
[5000000.0, 0.05],
[20000000.0, 0.1],
[50000000.0, 0.125],
[100000000.0, 0.15],
[200000000.0, 0.25],
[300000000.0, 0.5]],
'BNB/BUSD': [[0.0, 0.025, 0.0],
[100000.0, 0.05, 2500.0],
[500000.0, 0.1, 27500.0],
[1000000.0, 0.15, 77499.99999999999],
[2000000.0, 0.25, 277500.0],
[5000000.0, 0.5, 1527500.0]],
'BNB/USDT': [[0.0, 0.0065, 0.0],
[10000.0, 0.01, 35.00000000000001],
[50000.0, 0.02, 535.0],
[250000.0, 0.05, 8035.000000000001],
[1000000.0, 0.1, 58035.0],
[2000000.0, 0.125, 108034.99999999999],
[5000000.0, 0.15, 233034.99999999994],
[10000000.0, 0.25, 1233035.0]],
'BTC/USDT': [[0.0, 0.004, 0.0],
[50000.0, 0.005, 50.0],
[250000.0, 0.01, 1300.0],
[1000000.0, 0.025, 16300.000000000002],
[5000000.0, 0.05, 141300.0],
[20000000.0, 0.1, 1141300.0],
[50000000.0, 0.125, 2391300.0],
[100000000.0, 0.15, 4891300.0],
[200000000.0, 0.25, 24891300.0],
[300000000.0, 0.5, 99891300.0]
]
}
assert exchange.get_maintenance_ratio_and_amt(pair, nominal_value) == (mm_ratio, amt)