fix the rpc for balance which returns incorrect est. balance for the BTC pairs that starts with BTC such as BTCST/BTC

This commit is contained in:
Varun (Linux) 2021-02-10 10:39:42 +08:00
parent 3110d2dbb1
commit dff1c63769

View File

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