Hardcoded Fee Tier Selection in Uniswap v3 Swap Operation Potentially Leading to Suboptimal Swap Rate.
The sellProfits
function in the contract uses a hardcoded fee tier of 3000 for Uniswap v3 swap operations. This lack of flexibility in fee tier selection can lead to poor swap rates or failed transactions due to low liquidity or nonexistent pools.
There are some _profits
tokens in the contract.
The contract attempts to swap _profits
tokens for WETH at an optimal rate.
Due to the hardcoded fee tier of 3000, the swap operation may end up using a pool with lower liquidity or even a nonexistent pool.
As a result, the swap may occur at a suboptimal rate or fail entirely.
This design choice may lead to usage of a low liquidity pool or even a nonexistent pool, resulting in less optimal or failed swaps.
ChatGPT & VS Code
Consider implementing a dynamic fee tier selection mechanism: Instead of hardcoding the fee tier for swap operations, dynamically select the fee tier based on current pool liquidity. This could improve the swap rate significantly, particularly for larger transactions. Careful consideration should be given to balancing the optimality of swap rates against potential increases in complexity and gas costs.
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.