Don't use markets[pair]['quote']

This commit is contained in:
Matthias 2020-02-26 07:08:09 +01:00
parent 1021ffa1c3
commit 4e218be51d
3 changed files with 4 additions and 4 deletions

View File

@ -334,7 +334,7 @@ class Exchange:
logger.warning(f"Pair {pair} is restricted for some users on this exchange."
f"Please check if you are impacted by this restriction "
f"on the exchange and eventually remove {pair} from your whitelist.")
if not self.markets[pair].get('quote') == self._config['stake_currency']:
if not self.get_pair_quote_currency(pair) == self._config['stake_currency']:
invalid_pairs.append(pair)
if invalid_pairs:
raise OperationalException(

View File

@ -938,7 +938,8 @@ class FreqtradeBot:
"""
# Update wallets to ensure amounts tied up in a stoploss is now free!
self.wallets.update()
wallet_amount = self.wallets.get_free(self.exchange.get_pair_base_currency(pair))
trade_base_currency = self.exchange.get_pair_base_currency(pair)
wallet_amount = self.wallets.get_free(trade_base_currency)
logger.debug(f"{pair} - Wallet: {wallet_amount} - Trade-amount: {amount}")
if wallet_amount >= amount:
return amount
@ -1145,7 +1146,6 @@ class FreqtradeBot:
return order_amount
amount = 0
fee_abs = 0
trade_base_currency = self.exchange.get_pair_base_currency(trade.pair)
for exectrade in trades:
amount += exectrade['amount']
if ("fee" in exectrade and exectrade['fee'] is not None and

View File

@ -100,7 +100,7 @@ class IPairList(ABC):
f"{self._exchange.name}. Removing it from whitelist..")
continue
if markets[pair]['quote'] != self._config['stake_currency']:
if self._exchange.get_pair_quote_currency(pair) != self._config['stake_currency']:
logger.warning(f"Pair {pair} is not compatible with your stake currency "
f"{self._config['stake_currency']}. Removing it from whitelist..")
continue