use self.markets instead of get_markets
This commit is contained in:
		| @@ -280,12 +280,10 @@ class FreqtradeBot(object): | |||||||
|         return stake_amount |         return stake_amount | ||||||
|  |  | ||||||
|     def _get_min_pair_stake_amount(self, pair: str, price: float) -> Optional[float]: |     def _get_min_pair_stake_amount(self, pair: str, price: float) -> Optional[float]: | ||||||
|         markets = self.exchange.get_markets() |         try: | ||||||
|         markets = [m for m in markets if m['symbol'] == pair] |             market = self.exchange.markets[pair] | ||||||
|         if not markets: |         except KeyError: | ||||||
|             raise ValueError(f'Can\'t get market information for symbol {pair}') |             raise ValueError(f"Can't get market information for symbol {pair}") | ||||||
|  |  | ||||||
|         market = markets[0] |  | ||||||
|  |  | ||||||
|         if 'limits' not in market: |         if 'limits' not in market: | ||||||
|             return None |             return None | ||||||
|   | |||||||
| @@ -66,12 +66,14 @@ class IPairList(ABC): | |||||||
|         black_listed |         black_listed | ||||||
|         """ |         """ | ||||||
|         sanitized_whitelist = whitelist |         sanitized_whitelist = whitelist | ||||||
|         markets = self._freqtrade.exchange.get_markets() |         markets = self._freqtrade.exchange.markets | ||||||
|  |  | ||||||
|         # Filter to markets in stake currency |         # Filter to markets in stake currency | ||||||
|         markets = [m for m in markets if m['quote'] == self._config['stake_currency']] |         markets = [markets[pair] for pair in markets if | ||||||
|  |                    markets[pair]['quote'] == self._config['stake_currency']] | ||||||
|         known_pairs = set() |         known_pairs = set() | ||||||
|  |  | ||||||
|  |         # TODO: we should loop over whitelist instead of all markets | ||||||
|         for market in markets: |         for market in markets: | ||||||
|             pair = market['symbol'] |             pair = market['symbol'] | ||||||
|             # pair is not in the generated dynamic market, or in the blacklist ... ignore it |             # pair is not in the generated dynamic market, or in the blacklist ... ignore it | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user