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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user