updated test_load_leverage_tiers_okx

This commit is contained in:
Sam Germain 2022-02-25 12:58:47 -06:00
parent b71fb1fdec
commit af77358d6a

View File

@ -177,134 +177,130 @@ def test_load_leverage_tiers_okx(default_conf, mocker, markets):
'fetchMarketLeverageTiers': True, 'fetchMarketLeverageTiers': True,
}) })
api_mock.fetch_market_leverage_tiers = MagicMock(side_effect=[ api_mock.fetch_market_leverage_tiers = MagicMock(side_effect=[
{ [
'ADA/USDT:USDT': [ {
{ 'tier': 1,
'tier': 1, 'notionalFloor': 0,
'notionalFloor': 0, 'notionalCap': 500,
'notionalCap': 500, 'maintenanceMarginRate': 0.02,
'maintenanceMarginRate': 0.02, 'maxLeverage': 75,
'maxLeverage': 75, 'info': {
'info': { 'baseMaxLoan': '',
'baseMaxLoan': '', 'imr': '0.013',
'imr': '0.013', 'instId': '',
'instId': '', 'maxLever': '75',
'maxLever': '75', 'maxSz': '500',
'maxSz': '500', 'minSz': '0',
'minSz': '0', 'mmr': '0.01',
'mmr': '0.01', 'optMgnFactor': '0',
'optMgnFactor': '0', 'quoteMaxLoan': '',
'quoteMaxLoan': '', 'tier': '1',
'tier': '1', 'uly': 'ADA-USDT'
'uly': 'ADA-USDT' }
} },
}, {
{ 'tier': 2,
'tier': 2, 'notionalFloor': 501,
'notionalFloor': 501, 'notionalCap': 1000,
'notionalCap': 1000, 'maintenanceMarginRate': 0.025,
'maintenanceMarginRate': 0.025, 'maxLeverage': 50,
'maxLeverage': 50, 'info': {
'info': { 'baseMaxLoan': '',
'baseMaxLoan': '', 'imr': '0.02',
'imr': '0.02', 'instId': '',
'instId': '', 'maxLever': '50',
'maxLever': '50', 'maxSz': '1000',
'maxSz': '1000', 'minSz': '501',
'minSz': '501', 'mmr': '0.015',
'mmr': '0.015', 'optMgnFactor': '0',
'optMgnFactor': '0', 'quoteMaxLoan': '',
'quoteMaxLoan': '', 'tier': '2',
'tier': '2', 'uly': 'ADA-USDT'
'uly': 'ADA-USDT' }
} },
}, {
{ 'tier': 3,
'tier': 3, 'notionalFloor': 1001,
'notionalFloor': 1001, 'notionalCap': 2000,
'notionalCap': 2000, 'maintenanceMarginRate': 0.03,
'maintenanceMarginRate': 0.03, 'maxLeverage': 20,
'maxLeverage': 20, 'info': {
'info': { 'baseMaxLoan': '',
'baseMaxLoan': '', 'imr': '0.05',
'imr': '0.05', 'instId': '',
'instId': '', 'maxLever': '20',
'maxLever': '20', 'maxSz': '2000',
'maxSz': '2000', 'minSz': '1001',
'minSz': '1001', 'mmr': '0.02',
'mmr': '0.02', 'optMgnFactor': '0',
'optMgnFactor': '0', 'quoteMaxLoan': '',
'quoteMaxLoan': '', 'tier': '3',
'tier': '3', 'uly': 'ADA-USDT'
'uly': 'ADA-USDT' }
} },
}, ],
] [
}, {
{ 'tier': 1,
'ETH/USDT:USDT': [ 'notionalFloor': 0,
{ 'notionalCap': 2000,
'tier': 1, 'maintenanceMarginRate': 0.01,
'notionalFloor': 0, 'maxLeverage': 75,
'notionalCap': 2000, 'info': {
'maintenanceMarginRate': 0.01, 'baseMaxLoan': '',
'maxLeverage': 75, 'imr': '0.013',
'info': { 'instId': '',
'baseMaxLoan': '', 'maxLever': '75',
'imr': '0.013', 'maxSz': '2000',
'instId': '', 'minSz': '0',
'maxLever': '75', 'mmr': '0.01',
'maxSz': '2000', 'optMgnFactor': '0',
'minSz': '0', 'quoteMaxLoan': '',
'mmr': '0.01', 'tier': '1',
'optMgnFactor': '0', 'uly': 'ETH-USDT'
'quoteMaxLoan': '', }
'tier': '1', },
'uly': 'ETH-USDT' {
} 'tier': 2,
}, 'notionalFloor': 2001,
{ 'notionalCap': 4000,
'tier': 2, 'maintenanceMarginRate': 0.015,
'notionalFloor': 2001, 'maxLeverage': 50,
'notionalCap': 4000, 'info': {
'maintenanceMarginRate': 0.015, 'baseMaxLoan': '',
'maxLeverage': 50, 'imr': '0.02',
'info': { 'instId': '',
'baseMaxLoan': '', 'maxLever': '50',
'imr': '0.02', 'maxSz': '4000',
'instId': '', 'minSz': '2001',
'maxLever': '50', 'mmr': '0.015',
'maxSz': '4000', 'optMgnFactor': '0',
'minSz': '2001', 'quoteMaxLoan': '',
'mmr': '0.015', 'tier': '2',
'optMgnFactor': '0', 'uly': 'ETH-USDT'
'quoteMaxLoan': '', }
'tier': '2', },
'uly': 'ETH-USDT' {
} 'tier': 3,
}, 'notionalFloor': 4001,
{ 'notionalCap': 8000,
'tier': 3, 'maintenanceMarginRate': 0.02,
'notionalFloor': 4001, 'maxLeverage': 20,
'notionalCap': 8000, 'info': {
'maintenanceMarginRate': 0.02, 'baseMaxLoan': '',
'maxLeverage': 20, 'imr': '0.05',
'info': { 'instId': '',
'baseMaxLoan': '', 'maxLever': '20',
'imr': '0.05', 'maxSz': '8000',
'instId': '', 'minSz': '4001',
'maxLever': '20', 'mmr': '0.02',
'maxSz': '8000', 'optMgnFactor': '0',
'minSz': '4001', 'quoteMaxLoan': '',
'mmr': '0.02', 'tier': '3',
'optMgnFactor': '0', 'uly': 'ETH-USDT'
'quoteMaxLoan': '', }
'tier': '3', },
'uly': 'ETH-USDT' ]
}
},
]
},
]) ])
default_conf['trading_mode'] = 'futures' default_conf['trading_mode'] = 'futures'
default_conf['margin_mode'] = 'isolated' default_conf['margin_mode'] = 'isolated'