Fix bug with wrong conversion for BTCST/BTC

This can happen if a pair starts with the stake-currency

closes #4307
This commit is contained in:
Matthias 2021-02-04 19:58:44 +01:00
parent 17e1cfbd43
commit 1310a7b547

View File

@ -451,7 +451,7 @@ class RPC:
pair = self._freqtrade.exchange.get_valid_pair_combination(coin, stake_currency) pair = self._freqtrade.exchange.get_valid_pair_combination(coin, stake_currency)
rate = tickers.get(pair, {}).get('bid', None) rate = tickers.get(pair, {}).get('bid', None)
if rate: if rate:
if pair.startswith(stake_currency): if pair.startswith(stake_currency) and not pair.endswith(stake_currency):
rate = 1.0 / rate rate = 1.0 / rate
est_stake = rate * balance.total est_stake = rate * balance.total
except (ExchangeError): except (ExchangeError):