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 = <