mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
Update Tests data to work with new cached levtiers
This commit is contained in:
@@ -3342,7 +3342,7 @@ def leverage_tiers():
|
||||
'maintAmt': 386950.0
|
||||
},
|
||||
],
|
||||
"ADA/BUSD:BUSD": [
|
||||
"ADA/USDT:USDT": [
|
||||
{
|
||||
"minNotional": 0,
|
||||
"maxNotional": 100000,
|
||||
@@ -3386,7 +3386,7 @@ def leverage_tiers():
|
||||
"maintAmt": 1527500.0
|
||||
},
|
||||
],
|
||||
'BNB/BUSD:BUSD': [
|
||||
'XRP/USDT:USDT': [
|
||||
{
|
||||
"minNotional": 0, # stake(before leverage) = 0
|
||||
"maxNotional": 100000, # max stake(before leverage) = 5000
|
||||
|
||||
@@ -596,10 +596,10 @@ async def test__async_get_historic_ohlcv_binance(default_conf, mocker, caplog, c
|
||||
|
||||
|
||||
@pytest.mark.parametrize('pair,nominal_value,mm_ratio,amt', [
|
||||
("BNB/BUSD:BUSD", 0.0, 0.025, 0),
|
||||
("XRP/USDT:USDT", 0.0, 0.025, 0),
|
||||
("BNB/USDT:USDT", 100.0, 0.0065, 0),
|
||||
("BTC/USDT:USDT", 170.30, 0.004, 0),
|
||||
("BNB/BUSD:BUSD", 999999.9, 0.1, 27500.0),
|
||||
("XRP/USDT:USDT", 999999.9, 0.1, 27500.0),
|
||||
("BNB/USDT:USDT", 5000000.0, 0.15, 233035.0),
|
||||
("BTC/USDT:USDT", 600000000, 0.5, 1.997038E8),
|
||||
])
|
||||
|
||||
@@ -4969,8 +4969,8 @@ def test_get_maintenance_ratio_and_amt_exceptions(mocker, default_conf, leverage
|
||||
|
||||
|
||||
@pytest.mark.parametrize('pair,value,mmr,maintAmt', [
|
||||
('ADA/BUSD:BUSD', 500, 0.025, 0.0),
|
||||
('ADA/BUSD:BUSD', 20000000, 0.5, 1527500.0),
|
||||
('ADA/USDT:USDT', 500, 0.025, 0.0),
|
||||
('ADA/USDT:USDT', 20000000, 0.5, 1527500.0),
|
||||
('ZEC/USDT:USDT', 500, 0.01, 0.0),
|
||||
('ZEC/USDT:USDT', 20000000, 0.5, 654500.0),
|
||||
])
|
||||
@@ -5005,10 +5005,10 @@ def test_get_max_leverage_futures(default_conf, mocker, leverage_tiers):
|
||||
|
||||
exchange._leverage_tiers = leverage_tiers
|
||||
|
||||
assert exchange.get_max_leverage("BNB/BUSD:BUSD", 1.0) == 20.0
|
||||
assert exchange.get_max_leverage("XRP/USDT:USDT", 1.0) == 20.0
|
||||
assert exchange.get_max_leverage("BNB/USDT:USDT", 100.0) == 75.0
|
||||
assert exchange.get_max_leverage("BTC/USDT:USDT", 170.30) == 125.0
|
||||
assert pytest.approx(exchange.get_max_leverage("BNB/BUSD:BUSD", 99999.9)) == 5.000005
|
||||
assert pytest.approx(exchange.get_max_leverage("XRP/USDT:USDT", 99999.9)) == 5.000005
|
||||
assert pytest.approx(exchange.get_max_leverage("BNB/USDT:USDT", 1500)) == 33.333333333333333
|
||||
assert exchange.get_max_leverage("BTC/USDT:USDT", 300000000) == 2.0
|
||||
assert exchange.get_max_leverage("BTC/USDT:USDT", 600000000) == 1.0 # Last tier
|
||||
|
||||
@@ -196,7 +196,7 @@ def test_get_max_pair_stake_amount_okx(default_conf, mocker, leverage_tiers):
|
||||
exchange = get_patched_exchange(mocker, default_conf, id="okx")
|
||||
exchange._leverage_tiers = leverage_tiers
|
||||
|
||||
assert exchange.get_max_pair_stake_amount('BNB/BUSD:BUSD', 1.0) == 30000000
|
||||
assert exchange.get_max_pair_stake_amount('XRP/USDT:USDT', 1.0) == 30000000
|
||||
assert exchange.get_max_pair_stake_amount('BNB/USDT:USDT', 1.0) == 50000000
|
||||
assert exchange.get_max_pair_stake_amount('BTC/USDT:USDT', 1.0) == 1000000000
|
||||
assert exchange.get_max_pair_stake_amount('BTC/USDT:USDT', 1.0, 10.0) == 100000000
|
||||
|
||||
Reference in New Issue
Block a user