Skip to content

Commit

Permalink
add bi volume for swap
Browse files Browse the repository at this point in the history
  • Loading branch information
soilking committed Jun 13, 2024
1 parent 6aca74c commit 8b5700e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion projects/subgraph-basin/src/utils/VolumeCP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8b5700e

Please sign in to comment.