From b9c5b8004816f02f3451c5ee9f47121d353110bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pr=C3=A9vost?= <998369+prevostc@users.noreply.github.com> Date: Mon, 1 Jul 2024 00:39:38 +0200 Subject: [PATCH] fix price decimals --- src/clm/utils/clm-data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clm/utils/clm-data.ts b/src/clm/utils/clm-data.ts index 8f2911b..8c0cc46 100644 --- a/src/clm/utils/clm-data.ts +++ b/src/clm/utils/clm-data.ts @@ -181,7 +181,7 @@ export function fetchCLMData(clm: CLM): CLMData { } // price is the amount of token1 per token0, expressed with 36 decimals - const priceDecimals = BigInt.fromU32(36) + const priceDecimals = BigInt.fromU32(36).plus(token1.decimals).minus(token0.decimals) // this can revert when the liquidity is 0 let priceOfToken0InToken1 = ZERO_BI