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',