From da65fe78add2a5f9e2027a3cc960eab97c464eff Mon Sep 17 00:00:00 2001 From: arthurgousset <46296830+arthurgousset@users.noreply.github.com> Date: Mon, 1 Apr 2024 15:02:05 +0100 Subject: [PATCH] chore(constants): applies diffs from Jesse's subgraph PR Source: Jesse-Sawa#1 I'm applying all changes made in this PR "v3-subgraph for celo changes Uniswap#1" (Jesse-Sawa#1). In this commit, I had to modify the original diff from Jesse a little, because the source code has changed slightly since he made the change. --- src/mappings/position-manager.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mappings/position-manager.ts b/src/mappings/position-manager.ts index 49f5d7d1..794c3354 100644 --- a/src/mappings/position-manager.ts +++ b/src/mappings/position-manager.ts @@ -162,11 +162,13 @@ export function handleCollect(event: Collect): void { } let token0 = Token.load(position.token0) + let token1 = Token.load(position.token1) - if (token0) { + if (token0 && token1) { let amount0 = convertTokenToDecimal(event.params.amount0, token0.decimals) + let amount1 = convertTokenToDecimal(event.params.amount1, token1.decimals) position.collectedFeesToken0 = position.collectedFeesToken0.plus(amount0) - position.collectedFeesToken1 = position.collectedFeesToken1.plus(amount0) + position.collectedFeesToken1 = position.collectedFeesToken1.plus(amount1) } position = updateFeeVars(position, event, event.params.tokenId)