Merge pull request #1623 from iuvbio/markets_refactor

Markets refactor
This commit is contained in:
Matthias
2019-03-14 06:22:18 +01:00
committed by GitHub
12 changed files with 261 additions and 254 deletions

View File

@@ -155,6 +155,9 @@ class FreqtradeBot(object):
"""
state_changed = False
try:
# Check whether markets have to be reloaded
self.exchange._reload_markets()
# Refresh whitelist
self.pairlists.refresh_pairlist()
self.active_pair_whitelist = self.pairlists.whitelist
@@ -280,12 +283,10 @@ class FreqtradeBot(object):
return stake_amount
def _get_min_pair_stake_amount(self, pair: str, price: float) -> Optional[float]:
markets = self.exchange.get_markets()
markets = [m for m in markets if m['symbol'] == pair]
if not markets:
raise ValueError(f'Can\'t get market information for symbol {pair}')
market = markets[0]
try:
market = self.exchange.markets[pair]
except KeyError:
raise ValueError(f"Can't get market information for symbol {pair}")
if 'limits' not in market:
return None