From ed7e2e970d86786ee250cf38e2020ad143a992b9 Mon Sep 17 00:00:00 2001 From: Apeguru Date: Wed, 10 Apr 2024 18:10:22 -0300 Subject: [PATCH] refactor: Only return active TVL --- adapters/lynex/src/sdk/pools.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/adapters/lynex/src/sdk/pools.ts b/adapters/lynex/src/sdk/pools.ts index 60d3fd31..79c1c880 100644 --- a/adapters/lynex/src/sdk/pools.ts +++ b/adapters/lynex/src/sdk/pools.ts @@ -173,16 +173,8 @@ const getV3PositionReserves = (position: V3Position) => { const sqrtRatioB = Math.sqrt(1.0001 ** tickUpper); const sqrtPrice = _sqrtPrice / 2 ** 96; - // Onlye return active TVL - if (currentTick < tickLower) { - reserve0 = BigInt( - Math.floor( - liquidity * ((sqrtRatioB - sqrtRatioA) / (sqrtRatioA * sqrtRatioB)) - ) - ); - } else if (currentTick >= tickUpper) { - reserve1 = BigInt(Math.floor(liquidity * (sqrtRatioB - sqrtRatioA))); - } else if (currentTick >= tickLower && currentTick < tickUpper) { + // Only return active TVL + if (currentTick >= tickLower && currentTick < tickUpper) { reserve0 = BigInt( Math.floor( liquidity * ((sqrtRatioB - sqrtPrice) / (sqrtPrice * sqrtRatioB))