20,000 USDC
View results
Submission Details
Severity: high
Valid

price limit set to 0

Summary

We set this to zero - which makes this parameter inactive. This value can be used to set the limit for the price the swap will push the pool to, which can help protect against price impact or for setting up logic in a variety of price-relevant mechanisms.

Vulnerability Details

ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
tokenIn: _profits,
tokenOut: WETH,
fee: 3000,
recipient: address(this),
deadline: block.timestamp,
amountIn: amount,
amountOutMinimum: 0,
sqrtPriceLimitX96: 0
});

setting the price limit to 0 may cause price impact

Impact

price impact

Tools Used

manual

Recommendations

we need to set price limit for swap, because every swap has impact on price and this change in price will change your use case and effect so by sqrtPriceLimitX96, we can limit the swap

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.