Pre-auditThree days of senior audit time for $1,500, credited in full toward your Zealynx audit.3 audit days, credited toward your auditSee how →
M-01·

Hardcoded slippage tolerance risks poor trading or DOS

Not reportedoptionsleverageblack-scholes
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 estimation
return amountIn + (amountIn * 20_000) / DEX_PRECISION;
}

This implementation presents several critical issues:

  1. The fixed 2% slippage tolerance doesn't account for varying market conditions and liquidity pool depths.
  2. During periods of high market volatility, this fixed tolerance may be insufficient, leading to failed transactions (DOS).
  3. For highly liquid pools, 2% slippage is unnecessarily high, resulting in worse execution prices for users.
  4. 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.

M-01