M-01·
Hardcoded slippage tolerance risks poor trading or DOS
TL;DR
In the PositionInteractionFacet.sol contract, the slippage tolerance is hardcoded to 2% in the _applySlippage function:
Severity
MEDIUM
Method
MManual review
CAT.
02Section · Severity
Severity
Impact: Medium
Likelihood: Medium
03Section · Description
Description
In the PositionInteractionFacet.sol contract, the slippage tolerance is hardcoded to 2% in the _applySlippage function:
solidity
function _applySlippage(uint256 amountIn) internal pure returns (uint256) {// 2% slippage from quoter estimationreturn amountIn + (amountIn * 20_000) / DEX_PRECISION;}
This implementation presents several critical issues:
- The fixed 2% slippage tolerance doesn't account for varying market conditions and liquidity pool depths.
- During periods of high market volatility, this fixed tolerance may be insufficient, leading to failed transactions (DOS).
- For highly liquid pools, 2% slippage is unnecessarily high, resulting in worse execution prices for users.
- For low liquidity pools, 2% might be too low, causing transactions to fail when they could have succeeded with a higher tolerance.
04Section · Recommendations
Recommendations
Allow the tolerance to be set by the admin/owner.
05Section · Report provenance
Report provenance
Published by Pashov Audit Group, with Carlos (Bloqarl) participating as a contractor. The source report states that its fixes review was not fully completed; no final remediation disposition is recorded for this finding. Read the full report.