# ADL operations do not have any slippage protection

GMX ADL keeper orders set acceptablePrice to 0/max and minOutputAmount to 0, so auto-deleveraged users can suffer unlimited slippage and turn gains into losses.

- Payout: Contest reward
- Severity: high
- Program: Gmx
- Credited: Breeje
- Disclosed: 2022-09-22
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-02-gmx-judging/issues/143
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-02-gmx%3AH-5
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:solidity technique:source-review vuln:business-logic vuln:oracle-manipulation

**Target:** AdlUtils.createAdlOrder / AdlHandler in gmx-synthetics
**Root cause:** ADL orders are constructed with acceptablePrice of 0 (longs) or type(uint256).max (shorts) and minOutputAmount of 0, so no per-position slippage bound is enforced; only global metrics are checked post-execution.
**Steps:**
1. Read `AdlUtils.createAdlOrder()` at AdlUtils.sol L141-153.
2. Observe `acceptablePrice` set to `position.isLong() ? 0 : type(uint256).max` and `minOutputAmount` set to `0`.
3. Trigger ADL keeper execution during a price spike with many ADL operations queued.
4. Note that AdlHandler.sol L150-160 only validates global metrics, not position-specific output.
5. User's position is closed at an arbitrarily bad price, converting a large gain into a loss.
**How found:** Code review of the ADL order construction path, noticing hardcoded zero/max slippage parameters and that post-execution checks are only global, not position-specific.
**Exploitation:** Not attacker-triggered directly; the ADL keeper executes forced deleveraging at any price. During a sharp price spike with many users exiting, price impact grows and ADL users absorb unlimited slippage, realizing losses instead of gains.
**Insight:** When auditing keeper/automated order paths, check that acceptablePrice and minOutputAmount are derived from oracle/position state rather than hardcoded sentinels; forced-exit flows (ADL, liquidation) are prime spots for missing per-position slippage bounds.
