swap
function implements an UniswapV3 swap which takes fee
as one of the paramenters. This value is hardcoded to 3000
meaning 0,3%
swap fee for each swap. However there are liquidity pools with deeper liquidity and lower fees, that users could use to lower the cost of swap.
fee: 3000
is hardcoded in params
used to implement a swap.
Let's look at WETH/WBTC
pools on UniswapV3 on Arbitrum One (chain that they protocol will be deployed to)
0x149e36E72726e0BceA5c59d40df2c43F60f5A22D
WETH/WBTC
pool with 0,30%
fee
$3161649,83 in pool (30.12.2023 16:30 GMT+1)
0x2f5e87C9312fa29aed5c179E456625D79015299c
WETH/WBTC
pool with 0,05%
fee
$22058024,46 in pool (30.12.2023 16:30 GMT+1)
Looking at these two pools the second one (0x2f5e87C9312fa29aed5c179E456625D79015299c
) provides better environment to swap tokens. Not only it does have a smaller fee but it also has deeper liquidity allowing users for better swap prices.
There could also be pools in the future that do not have 0,3%
but have 0,05%
or 0,01%
fee and due to static fee user will not be able to use them through swap
function.
User could lose money due to static fee. There are pools with lower fees and deeper liquidity, improving user's swap quality and prices.
VScode, Manual Review
Allow user to parametrize fee
in swap
function.
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.