From 71f9abc60293e505cf6f9544ffc94268734d4f6a Mon Sep 17 00:00:00 2001 From: none00y Date: Tue, 15 Oct 2024 17:40:53 +0200 Subject: [PATCH] fix validate state --- cron/src/validate-state.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cron/src/validate-state.ts b/cron/src/validate-state.ts index 7a5b3e9e..2aa4b44b 100644 --- a/cron/src/validate-state.ts +++ b/cron/src/validate-state.ts @@ -41,8 +41,8 @@ const main = async () => { for (const [poolKey, pool, liquidityTicks] of poolsWithTicks) { const { liquidityX, liquidityY } = getPairLiquidityValues(pool, liquidityTicks) - const newBalanceX = (balances.get(poolKey.tokenX) ?? 0n) + liquidityX - const newBalanceY = (balances.get(poolKey.tokenY) ?? 0n) + liquidityY + const newBalanceX = (balances.get(poolKey.tokenX) ?? 0n) + liquidityX + pool.feeProtocolTokenX + const newBalanceY = (balances.get(poolKey.tokenY) ?? 0n) + liquidityY + pool.feeProtocolTokenY balances.set(poolKey.tokenX, newBalanceX) balances.set(poolKey.tokenY, newBalanceY)