Skip to content

Commit

Permalink
Merge pull request #310 from invariant-labs/fix-validate-state
Browse files Browse the repository at this point in the history
fix validate state
  • Loading branch information
none00y authored Oct 16, 2024
2 parents eba19c8 + 71f9abc commit b405362
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cron/src/validate-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b405362

Please sign in to comment.