From cfc8e9c2ffb3b09ee634cd0b79e4a1217896657b Mon Sep 17 00:00:00 2001 From: Eric Fornaciari Date: Tue, 10 Feb 2026 12:53:16 -0800 Subject: [PATCH] DF-23009: [POC] Case Insensitive --- src/adapter/price.ts | 6 ++++++ src/config/index.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/adapter/price.ts b/src/adapter/price.ts index 9bd8a347..0194f24f 100644 --- a/src/adapter/price.ts +++ b/src/adapter/price.ts @@ -145,11 +145,17 @@ export class PriceAdapter< includesDetails?.endpoints === undefined || includesDetails?.endpoints?.includes(req.requestContext.endpointName) ) { + if (includesDetails) { requestData.base = includesDetails.from || requestData.base requestData.quote = includesDetails.to || requestData.quote } + if (this.config.settings.ASSET_CASE_INSENSITIVE) { + requestData.base = requestData.base.toLowerCase() + requestData.quote = requestData.quote.toLowerCase() + } + const inverse = includesDetails?.inverse || false priceRequest.requestContext.priceMeta = { inverse, diff --git a/src/config/index.ts b/src/config/index.ts index 0c62b9bb..e4169171 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -372,6 +372,12 @@ export const BaseSettingsDefinition = { 'Whether to enable debug enpoints (/debug/*) for this adapter. Enabling them might consume more resources.', default: false, }, + ASSET_CASE_INSENSITIVE: { + type: 'boolean', + description: + 'Whether to treat asset symbols as case insensitive when generating cache keys and handling requests.', + default: false, + }, } as const satisfies SettingsDefinitionMap export const buildAdapterSettings = <