We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9eca2e commit 9f82c52Copy full SHA for 9f82c52
subgraphs/v3-vault/src/mappings/vault.ts
@@ -330,8 +330,14 @@ export function handleSwap(event: SwapEvent): void {
330
let swapFeeDeltaAmount = ZERO_BD;
331
if (hasDynamicSwapFee) {
332
let swapFeeDelta = swapFeePercentage.minus(pool.swapFee);
333
- swapFeeBaseAmount = tokenAmountIn.times(pool.swapFee);
334
- swapFeeDeltaAmount = tokenAmountIn.times(swapFeeDelta);
+ swapFeeBaseAmount = scaleDown(
+ mulDownSwapFee(event.params.amountIn, pool.swapFee),
335
+ tokenIn.decimals
336
+ );
337
+ swapFeeDeltaAmount = scaleDown(
338
+ mulDownSwapFee(event.params.amountIn, swapFeeDelta),
339
340
341
}
342
343
swap.pool = event.params.pool;
0 commit comments