Isolated liq branch passes all tests and has the general structure that it is supposed to, but is patchy, and doesnt get the correct maintenance amt and maintenance margin rate yet

This commit is contained in:
Sam Germain
2021-11-05 19:27:06 -06:00
parent eee7271ab8
commit ba02605d77
6 changed files with 103 additions and 44 deletions

View File

@@ -3582,6 +3582,24 @@ def test_calculate_funding_fees(
) == kraken_fee
def test_get_liquidation_price(mocker, default_conf):
api_mock = MagicMock()
api_mock.fetch_positions = MagicMock()
type(api_mock).has = PropertyMock(return_value={'fetchPositions': True})
default_conf['dry_run'] = False
ccxt_exceptionhandlers(
mocker,
default_conf,
api_mock,
"binance",
"get_liquidation_price",
"fetch_positions",
pair="XRP/USDT"
)
@pytest.mark.parametrize('exchange,rate_start,rate_end,d1,d2,amount,expected_fees', [
('binance', 0, 2, "2021-09-01 00:00:00", "2021-09-01 08:00:00", 30.0, -0.0009140999999999999),
('binance', 0, 2, "2021-09-01 00:00:15", "2021-09-01 08:00:00", 30.0, -0.0009140999999999999),