diff --git a/freqtrade/fiat_convert.py b/freqtrade/fiat_convert.py index 3ec4c8c76..68f27e448 100644 --- a/freqtrade/fiat_convert.py +++ b/freqtrade/fiat_convert.py @@ -182,8 +182,9 @@ class CryptoToFiatConverter(object): raise ValueError('The fiat {} is not supported.'.format(fiat_symbol)) if crypto_symbol not in self.CRYPTOMAP: - raise ValueError( - 'The crypto symbol {} is not supported.'.format(crypto_symbol)) + # simply return 0 for unsupported stake currencies (fiat-convert should not break the bot) + logger.warning("unsupported crypto-symbol %s - returning 0.0", crypto_symbol) + return 0.0 try: return float( self._coinmarketcap.ticker( diff --git a/freqtrade/tests/test_fiat_convert.py b/freqtrade/tests/test_fiat_convert.py index dcbc7b936..358148aa0 100644 --- a/freqtrade/tests/test_fiat_convert.py +++ b/freqtrade/tests/test_fiat_convert.py @@ -77,8 +77,8 @@ def test_fiat_convert_find_price(mocker): with pytest.raises(ValueError, match=r'The fiat ABC is not supported.'): fiat_convert._find_price(crypto_symbol='BTC', fiat_symbol='ABC') - with pytest.raises(ValueError, match=r'The crypto symbol XRP is not supported.'): - fiat_convert.get_price(crypto_symbol='XRP', fiat_symbol='USD') + # with pytest.raises(ValueError, match=r'The crypto symbol XRP is not supported.'): + assert fiat_convert.get_price(crypto_symbol='XRP', fiat_symbol='USD') == 0.0 mocker.patch('freqtrade.fiat_convert.CryptoToFiatConverter._find_price', return_value=12345.0) assert fiat_convert.get_price(crypto_symbol='BTC', fiat_symbol='USD') == 12345.0