Revert "moved get_max_leverage to get_min_pair_stake_amount"

This reverts commit 90e48d5b98bcfb1452aa818a3274745eac395712.
This commit is contained in:
Sam Germain
2022-01-31 02:31:44 -06:00
parent 73319a74d3
commit 64ad810445
2 changed files with 95 additions and 27 deletions

View File

@@ -4050,18 +4050,35 @@ def test_get_max_amount_tradable(
):
api_mock = MagicMock()
exchange = get_patched_exchange(mocker, default_conf, api_mock)
# TODO-lev: Move this to test_get_min_pair_stake_amount
markets = {
'XRP/USDT': {
'limits': {
'leverage': {
'min': None,
'max': None,
},
'amount': {
'min': 0.001,
'max': 10000
},
'price': {
'min': 39.86,
'max': 306177
},
'cost': {
'min': 5,
'max': None
},
'market': {
'min': 0.001,
'max': 2000
},
},
'precision': {
'price': 2,
'amount': 3,
'base': 8,
'quote': 8
},
'contractSize': None,
'spot': False,
@@ -4069,14 +4086,32 @@ def test_get_max_amount_tradable(
},
'LTC/USDT': {
'limits': {
'leverage': {
'min': None,
'max': None,
},
'amount': {
'min': 0.001,
'max': None
},
'price': {
'min': 39.86,
'max': 306177
},
'cost': {
'min': 5,
'max': None
},
'market': {
'min': 0.001,
'max': 2000
},
},
'precision': {
'price': 2,
'amount': 3,
'base': 8,
'quote': 8
},
'contractSize': 0.01,
'spot': False,
@@ -4084,14 +4119,32 @@ def test_get_max_amount_tradable(
},
'ETH/USDT': {
'limits': {
'leverage': {
'min': None,
'max': None,
},
'amount': {
'min': 0.001,
'max': 10000
},
'price': {
'min': 39.86,
'max': 306177
},
'cost': {
'min': 5,
'max': None
},
'market': {
'min': 0.001,
'max': 2000
},
},
'precision': {
'price': 2,
'amount': 3,
'base': 8,
'quote': 8
},
'contractSize': 0.01,
'spot': False,
@@ -4099,22 +4152,40 @@ def test_get_max_amount_tradable(
},
'BTC/USDT': {
'limits': {
'leverage': {
'min': None,
'max': None,
},
'amount': {
'min': 0.001,
'max': 10000
},
'price': {
'min': 39.86,
'max': 306177
},
'cost': {
'min': 5,
'max': None
},
'market': {
'min': 0.001,
'max': 2000
},
},
'precision': {
'price': 2,
'amount': 3,
'base': 8,
'quote': 8
},
'contractSize': 0.01,
'spot': True,
'swap': False
}
}
# mocker.patch('freqtrade.exchange.Exchange.markets', markets)
# assert exchange.get_max_amount_tradable('XRP/USDT') == 10000
# assert exchange.get_max_amount_tradable('LTC/USDT') == float('inf')
# assert exchange.get_max_amount_tradable('ETH/USDT') == 100
# assert exchange.get_max_amount_tradable('BTC/USDT') == 10000
mocker.patch('freqtrade.exchange.Exchange.markets', markets)
assert exchange.get_max_amount_tradable('XRP/USDT') == 10000
assert exchange.get_max_amount_tradable('LTC/USDT') == float('inf')
assert exchange.get_max_amount_tradable('ETH/USDT') == 100
assert exchange.get_max_amount_tradable('BTC/USDT') == 10000