diff --git a/prices/prices.service.ts b/prices/prices.service.ts index c2e2a61..9c829f5 100644 --- a/prices/prices.service.ts +++ b/prices/prices.service.ts @@ -221,11 +221,7 @@ export class PricesService { async updatePrices() { this.logger.debug('Updating Prices'); - const euroPrice = await this.fetchEuroPrice(); - if (euroPrice) { - this.euroPrice = euroPrice; - this.euroPriceTimestamp = Date.now(); - } + await this.refreshEuroPriceIfStale(); const deps = this.getDeps(); const m = this.getMint(); @@ -263,6 +259,9 @@ export class PricesService { if (!price) { pricesQueryUpdateCountFailed += 1; + // bump timestamp on failure so we honour the 5-minute retry window + // instead of refetching on every block tick when a token has no price source + pricesQuery[addr] = { ...oldEntry, timestamp: Date.now() }; } else { pricesQuery[addr] = { ...erc,