From 3e07af1eaa7a5bf0161c48b9fbc2b5a38c4f80d2 Mon Sep 17 00:00:00 2001 From: TaprootFreak <142087526+TaprootFreak@users.noreply.github.com> Date: Thu, 14 May 2026 18:33:00 +0200 Subject: [PATCH 1/2] Honor euro-price TTL inside updatePrices (#110) updatePrices() fetched the tether/eur reference on every block tick, bypassing the existing 60s in-memory cache that getEuroPrice() and getDepsPrice() already respected. With block intervals of 6-12s this generated ~5-10x more upstream calls than the cache was designed to allow, exhausting the monthly CoinGecko quota. Route the call through refreshEuroPriceIfStale() so the same TTL applies to all entry points. --- prices/prices.service.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/prices/prices.service.ts b/prices/prices.service.ts index c2e2a61..b53ea6f 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(); From 9b0a98c087ed1a8d7cf0ff241798e021fd26544f Mon Sep 17 00:00:00 2001 From: TaprootFreak <142087526+TaprootFreak@users.noreply.github.com> Date: Thu, 14 May 2026 19:06:09 +0200 Subject: [PATCH 2/2] Stop refetching tokens without a price source on every block (#112) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When fetchPrice() returns null/undefined (e.g. CoinGecko returns {} for an unlisted collateral token), 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 6-12s block polling that drives updatePrices(), this made the same handful of unlisted tokens generate ~50 upstream calls per hour per API instance — the dominant CoinGecko quota consumer after #110. 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 b53ea6f..9c829f5 100644 --- a/prices/prices.service.ts +++ b/prices/prices.service.ts @@ -259,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,