From 2bb335d950e297c54de86fc75deae46a4acba491 Mon Sep 17 00:00:00 2001 From: Peter van Mourik Date: Sun, 28 Jun 2026 12:06:43 +0000 Subject: [PATCH] fix(coinmarketcap): scope crypto batch requests to their own quote currency The crypto transport builds one HTTP request per unique quote currency (convert=) but tags each request with the full param list across all quotes. parseResponse then looks up data.quote[p.quote] for every attached param, so any param whose quote differs from the request's convert returns a spurious 502 "Data for quote X not found". Because each param is attached to every per-quote request, the per-param reconciliation is order-dependent and the failing set is non-deterministic and key-independent. Filter each request's params down to the params sharing its quote, so each param is resolved only by the request that requested its convert. One line; no behavioural change for single-quote batches. Signed-off-by: Peter van Mourik --- .changeset/coinmarketcap-crypto-quote-filter.md | 5 +++++ packages/sources/coinmarketcap/src/transport/crypto.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/coinmarketcap-crypto-quote-filter.md diff --git a/.changeset/coinmarketcap-crypto-quote-filter.md b/.changeset/coinmarketcap-crypto-quote-filter.md new file mode 100644 index 00000000000..7687f3017d3 --- /dev/null +++ b/.changeset/coinmarketcap-crypto-quote-filter.md @@ -0,0 +1,5 @@ +--- +'@chainlink/coinmarketcap-adapter': patch +--- + +Fix crypto transport attaching the full param list to every per-quote request, which caused intermittent 502 "Data for quote X not found" for any param whose quote differed from the request's convert. diff --git a/packages/sources/coinmarketcap/src/transport/crypto.ts b/packages/sources/coinmarketcap/src/transport/crypto.ts index 27f0b124475..af3710d9f0a 100644 --- a/packages/sources/coinmarketcap/src/transport/crypto.ts +++ b/packages/sources/coinmarketcap/src/transport/crypto.ts @@ -92,7 +92,7 @@ export const httpTransport = new HttpTransport({ const uniqueQuotes = [...new Set(list.map((p) => p.quote.toUpperCase()))] uniqueQuotes.forEach((uniqueQuote) => { requests.push({ - params: list, + params: list.filter((p) => p.quote.toUpperCase() === uniqueQuote), request: { baseURL: settings.API_ENDPOINT, url: '/cryptocurrency/quotes/latest',