Revert "Removed leverage param from get_min_pair_stake_amount"

This reverts commit 096588550ca1de5e5edf63cf7214af037d7bc93b.
This commit is contained in:
Sam Germain
2021-11-17 07:17:27 -06:00
parent 2df5993812
commit ee63f12236
2 changed files with 47 additions and 5 deletions

View File

@@ -649,7 +649,10 @@ class Exchange:
if ('amount' in limits and 'min' in limits['amount']
and limits['amount']['min'] is not None):
self._contract_size_to_amount(pair, min_stake_amounts.append(limits['amount']['min'] * price))
self._contract_size_to_amount(
pair,
min_stake_amounts.append(limits['amount']['min'] * price)
)
if not min_stake_amounts:
return None
@@ -837,15 +840,15 @@ class Exchange:
def _amount_to_contract_size(self, pair: str, amount: float):
if ('contractSize' in self.markets[pair]):
return amount / self.markets[pair]['contractSize']
if ('contractSize' in self._api.markets[pair]):
return amount / self._api.markets[pair]['contractSize']
else:
return amount
def _contract_size_to_amount(self, pair: str, amount: float):
if ('contractSize' in self.markets[pair]):
return amount * self.markets[pair]['contractSize']
if ('contractSize' in self._api.markets[pair]):
return amount * self._api.markets[pair]['contractSize']
else:
return amount