diff --git a/projects/subgraph-basin/src/utils/Well.ts b/projects/subgraph-basin/src/utils/Well.ts index 585068f484..bc7d5c276b 100644 --- a/projects/subgraph-basin/src/utils/Well.ts +++ b/projects/subgraph-basin/src/utils/Well.ts @@ -94,6 +94,12 @@ export function updateWellVolumes( let usdVolume = toDecimal(amountIn, swapToken.decimals).times(swapToken.lastPriceUSD); + // Remove liquidity one token has no input token amount to calculate volume. + if (amountIn == ZERO_BI) { + swapToken = loadToken(toToken); + usdVolume = toDecimal(amountOut.div(BigInt.fromI32(2)), swapToken.decimals).times(swapToken.lastPriceUSD); + } + // Update fromToken amounts let volumeReserves = well.cumulativeVolumeReserves;