Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: medium
Invalid

Unenforced Slippage in DexSwapStrategy

Summary: DexSwapStrategy.sol does not enforce minimum output amounts, exposing swaps to MEV attacks.

Vulnerability Details:
The executeSwap function in DexSwapStrategy.sol calculates minAmountOut using a fixed multiplier without real-time validation. Front-runners can manipulate DEX pools to worsen swap rates, causing significant slippage.

Code Reference:

// DexSwapStrategy.sol
uint256 minAmountOut = estimatedOutput * 95 / 100; // Static 5% slippage
dexAdapter.swap(..., minAmountOut);


Attack Scenario:
A user initiates a large swap. A front-runner sandwiches the transaction, inflating the price before the swap and selling afterward. The user receives 10% less than expected due to unadjusted slippage tolerance.

Impact: Medium – Financial loss for users due to unfavorable swaps.

Recommendations:

  1. Derive minAmountOut dynamically using real-time TWAP oracles.

  2. Allow users to submit custom slippage tolerances.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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