From 690e417a62e8722c5379e170e61874c1b7dac703 Mon Sep 17 00:00:00 2001 From: TaprootFreak <142087526+TaprootFreak@users.noreply.github.com> Date: Fri, 15 May 2026 19:51:00 +0200 Subject: [PATCH] Stop refetching tokens without a price source on every block Same retry-storm bug we fixed in d-EURO API (PR d-EURO/api#112): when fetchPrice() returns no usd value (e.g. an unlisted collateral token where CoinGecko returns {}), updatePrices() left the cache entry untouched and the 5-minute staleness check (timestamp + 300_000 < now) was still true on the next block tick. Combined with the 10 s block polling that drives updatePrices(), this made the same handful of unlisted tokens generate a steady upstream MISS on every cycle, leaking through the pricing-proxy's 60 s cache once per minute per token. Bump the entry's timestamp on a failed fetch too, so the retry honours the same 5-minute window as a successful fetch. --- prices/prices.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prices/prices.service.ts b/prices/prices.service.ts index 2aed006..edbc207 100644 --- a/prices/prices.service.ts +++ b/prices/prices.service.ts @@ -195,6 +195,9 @@ export class PricesService { if (!price?.usd) { 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,