In normal behavior, _beforeSwap calculates a dynamic LP fee based on the buy or sell direction. The fee is used to generate the LP fee override applied to swaps in Uniswap V4.
The issue is that the code computes feeAmount using a denominator of 100_000, while Uniswap V4 pools expect fees scaled to 1_000_000 (MAX_LP_FEE). This creates a 10× discrepancy between the intended and actual fee:
For example, a configured sellFee = 3_000 is treated as 3% by the hook, but Uniswap interprets it as 0.3%, causing misreporting and incorrect fee application.
Likelihood:
High, since any sell swap triggers this calculation.
Medium, because users assume fees match reported percentages, but actual fees are off by 10×.
Impact:
Users are overcharged or undercharged compared to intended ReFi economics.
Protocol revenue projections and tokenomics incentives are misaligned.
Explanation
This test demonstrates that a swap reports an incorrect fee amount due to the denominator mismatch.
This demonstrates that the fee applied to swaps is mis-scaled, leading to unintended financial behavior.
Adjust _beforeSwap to use the correct denominator corresponding to Uniswap V4’s MAX_LP_FEE (1_000_000).
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.