From 8b5700ef8fa33701c082e10c96826fad2ec44cbd Mon Sep 17 00:00:00 2001 From: Soil King <157099073+soilking@users.noreply.github.com> Date: Thu, 13 Jun 2024 12:46:14 -0700 Subject: [PATCH] add bi volume for swap --- projects/subgraph-basin/src/utils/VolumeCP.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/subgraph-basin/src/utils/VolumeCP.ts b/projects/subgraph-basin/src/utils/VolumeCP.ts index f28c00d3f3..263e3f8cfa 100644 --- a/projects/subgraph-basin/src/utils/VolumeCP.ts +++ b/projects/subgraph-basin/src/utils/VolumeCP.ts @@ -21,7 +21,8 @@ export function updateWellVolumesAfterSwap( const deltaTradeVolumeReserves = emptyBigIntArray(well.tokens.length); const deltaTransferVolumeReserves = emptyBigIntArray(well.tokens.length); - // Trade volume is considered on the buying end of the trade + // Trade volume is will ignore the selling end (negative) + deltaTradeVolumeReserves[well.tokens.indexOf(fromToken)] = amountIn.neg(); deltaTradeVolumeReserves[well.tokens.indexOf(toToken)] = amountOut; // Transfer volume is considered on both ends of the trade deltaTransferVolumeReserves[well.tokens.indexOf(fromToken)] = amountIn;