1
0

exchange_rate: "BTC" to "BTC" rate is not guaranteed to be present

Which ccy rates are available depends on the configured
exchange (config key use_exchange) and the configured currency (config
key currency). Only for some exchanges, the fx.ccy-BTC fx rate is
available (depends on the ExchangeBase.get_rates implementation).

As they say, for hodlers 1 BTC = 1 BTC.
This commit is contained in:
Joel Lehtonen
2022-12-06 02:19:12 +02:00
parent 09170bdd1f
commit 0b540956fb

View File

@@ -176,6 +176,8 @@ class ExchangeBase(Logger):
def get_cached_spot_quote(self, ccy: str) -> Decimal:
"""Returns the cached exchange rate as a Decimal"""
if ccy == 'BTC':
return Decimal(1)
rate = self._quotes.get(ccy)
if rate is None:
return Decimal('NaN')