# Manipulable slippage bounds in DeFi

minOut or liquidity floor derived from the same spot price it guards, so it never binds

_Area: DeFi oracles, liquidations and flash loans. Seen in 14 disclosed reports; latest 2025-11-10. Updated 2026-10-22._

## How it works
A slippage guard is supposed to encode the user's intent: "do not execute worse than X." It only works if X comes from a reference the attacker cannot move. The recurring bug is that X is computed from the same live pool state (spot reserves, `getAmountsOut`, current sqrt price) that the trade itself moves. The guard then tracks the manipulation: push the price, and both the execution price and the floor shift together, so the check always passes. The broken assumption is that a spot quote is an independent truth; it is an input the attacker controls within one transaction.

## Where it shows up
- `minOut`/`minAmount` computed from `getAmountsOut`, pool reserves, or `sqrt_price` in the same call that swaps or deposits [E2](https://bugbountylibrary.com/r/dhl%3A20251110-drlvaultv3.md)[E4](https://bugbountylibrary.com/r/c4%3A2023-03-asymmetry%3AH-08.md)[E6](https://bugbountylibrary.com/r/c4%3A2025-04-virtuals-protocol%3AM-06.md).
- Router calls with `minAmount = 1` or a hardcoded tiny floor [E1](https://bugbountylibrary.com/r/sherlock%3A2024-06-velocimeter%3AH-5.md).
- LP deposits sizing liquidity from a max-token amount at spot price rather than a user-signed target [E3](https://bugbountylibrary.com/r/cantina%3Aolas_lockbox_jan2024%3A3.1.1.md).
- A protocol-computed floor whose formula mirrors the AMM's payout formula [E5](https://bugbountylibrary.com/r/sherlock%3A2023-02-notional%3AH-3.md).
- Slippage reference priced off a different asset than the actual output [E7](https://bugbountylibrary.com/r/sherlock%3A2024-04-alchemix%3AH-1.md).
- Spread/premium formulas that ignore incoming order size [E8](https://bugbountylibrary.com/r/sherlock%3A2024-02-perpetual%3AM-1.md).

## How to review
Identify the reference used for the floor and ask: can the same transaction that executes the trade also move this reference? The invariant: the slippage bound must be derived from a source independent of the pool being traded (user-signed amount, external oracle, prior-block TWAP with a manipulation-resistant window), and the floor formula must differ from the payout formula. For LP deposits, the user must sign the liquidity amount, not a max-token cap [E3](https://bugbountylibrary.com/r/cantina%3Aolas_lockbox_jan2024%3A3.1.1.md). For quotes, verify the feed matches the actual output asset [E7](https://bugbountylibrary.com/r/sherlock%3A2024-04-alchemix%3AH-1.md).

## Variants seen
- Proportional deposit from spot reserves with `minAmount=1` [E1](https://bugbountylibrary.com/r/sherlock%3A2024-06-velocimeter%3AH-5.md).
- `minOut` from live pool quote in the same tx [E2](https://bugbountylibrary.com/r/dhl%3A20251110-drlvaultv3.md)[E6](https://bugbountylibrary.com/r/c4%3A2025-04-virtuals-protocol%3AM-06.md).
- Liquidity sized from max-token at spot sqrt price [E3](https://bugbountylibrary.com/r/cantina%3Aolas_lockbox_jan2024%3A3.1.1.md).
- Spot-derived floor with a fixed % buffer, still sandwichable [E4](https://bugbountylibrary.com/r/c4%3A2023-03-asymmetry%3AH-08.md).
- Floor formula identical to AMM payout, a no-op [E5](https://bugbountylibrary.com/r/sherlock%3A2023-02-notional%3AH-3.md).
- Wrong price feed for the output asset [E7](https://bugbountylibrary.com/r/sherlock%3A2024-04-alchemix%3AH-1.md).
- Spread ignoring order size, bypassable by reverse-then-open [E8](https://bugbountylibrary.com/r/sherlock%3A2024-02-perpetual%3AM-1.md).

## Impact and severity
Losses range from ~9% of intended LP [E1](https://bugbountylibrary.com/r/sherlock%3A2024-06-velocimeter%3AH-5.md) to a 100k USDT drain [E2](https://bugbountylibrary.com/r/dhl%3A20251110-drlvaultv3.md), with sandwichable stakes and settlements [E4](https://bugbountylibrary.com/r/c4%3A2023-03-asymmetry%3AH-08.md)[E5](https://bugbountylibrary.com/r/sherlock%3A2023-02-notional%3AH-3.md). Severity rises when the guard is the only protection and flash loans make the capital cost of manipulation near zero.

## Evidence
- E1: https://bugbountylibrary.com/r/sherlock%3A2024-06-velocimeter%3AH-5.md
- E2: https://bugbountylibrary.com/r/dhl%3A20251110-drlvaultv3.md
- E3: https://bugbountylibrary.com/r/cantina%3Aolas_lockbox_jan2024%3A3.1.1.md
- E4: https://bugbountylibrary.com/r/c4%3A2023-03-asymmetry%3AH-08.md
- E5: https://bugbountylibrary.com/r/sherlock%3A2023-02-notional%3AH-3.md
- E6: https://bugbountylibrary.com/r/c4%3A2025-04-virtuals-protocol%3AM-06.md
- E7: https://bugbountylibrary.com/r/sherlock%3A2024-04-alchemix%3AH-1.md
- E8: https://bugbountylibrary.com/r/sherlock%3A2024-02-perpetual%3AM-1.md
