You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sellProfits function is always using the 0.3% fee pool, which may not be the most liquid one for the specified token pair, leading to worse slippage and price impact.
Vulnerability Details
The sellProfits function in Fees.sol swaps profits from one token to WETH. The issue arises due to the contract only using the 0.3% fee pools for each of the swaps.
ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
tokenIn: _profits,
tokenOut: WETH,
fee: 3000, // @audit the fee is hard coded to 0.3% in basis points <
recipient: address(this),
deadline: block.timestamp,
amountIn: amount,
amountOutMinimum: 0,
sqrtPriceLimitX96: 0
});
This is an issue because some pairs' 0.3% pools may not be the most liquid ones. If the pool is not the most liquid one the swap will experience higher slippage than needed, losing some amount of funds in the process.
Impact
The slippage on swaps in pools with less liquidity will be higher than can be even with proper slippage tolerance.
Tools Used
Manual Review
Recommendations
Consider checking the liquidity in each of the available pools for the pair and swapping in the most liquid one.
The text was updated successfully, but these errors were encountered:
We've seen this in other competitions. Going to drop to medium pending the sponsors' thoughts. High doesn't make sense. here, it's just non-optimal slippage.
The 0.3% fee Uniswap pool for the specified token pair may not be the most liquid one leading to worse price impact and slippage
Severity
High Risk
Relevant GitHub Links
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Fees.sol#L34
Summary
The sellProfits function is always using the 0.3% fee pool, which may not be the most liquid one for the specified token pair, leading to worse slippage and price impact.
Vulnerability Details
The
sellProfits
function inFees.sol
swaps profits from one token to WETH. The issue arises due to the contract only using the 0.3% fee pools for each of the swaps.This is an issue because some pairs' 0.3% pools may not be the most liquid ones. If the pool is not the most liquid one the swap will experience higher slippage than needed, losing some amount of funds in the process.
Impact
The slippage on swaps in pools with less liquidity will be higher than can be even with proper slippage tolerance.
Tools Used
Manual Review
Recommendations
Consider checking the liquidity in each of the available pools for the pair and swapping in the most liquid one.
The text was updated successfully, but these errors were encountered: