The number shown before a token swap is a quote. The transaction still needs to execute, and what happens around it can influence the price you receive.

Ordering can have economic value

Maximal extractable value, or MEV, describes value available through transaction inclusion, exclusion, or ordering beyond ordinary fees and rewards. Ethereum's MEV documentation explains the different participants and strategies involved.

MEV is a broad category. Arbitrage and a sandwich attack are not interchangeable descriptions of the same event.

How a sandwich works

In a simplified sandwich, an attacker trades before a target swap, the target executes at a changed price, and the attacker trades again afterwards. The opportunity depends on the market mechanics and the ability to place transactions in a useful order.

Uniswap's sandwich-attack explanation connects this behaviour to transaction visibility and slippage.

Think of the user's trade as the middle event in a sequence. Looking at that event alone can hide the surrounding activity that changed its outcome.

Slippage is a boundary, not a promise

Slippage tolerance sets a limit on how far execution can differ from the quote under the application's rules. It does not force a particular execution price. Uniswap's slippage guide discusses the causes of price changes and the trade-offs involved.

For a deliberately simple example, imagine a quote of 100 output tokens and a setting allowing 1% negative deviation. Ignoring additional details, that corresponds to a boundary near 99 tokens. It is not a prediction that 99 tokens will be received, or a diagnosis of why the price moved.

Keep the costs separate

Our suggested swap record includes the original quote, executed output, network fee, pool or service fees, and the price impact reported by the application.

Without those fields, a disappointing result is easy to blame on a single cause. Thin liquidity, moving prices, fees, and adversarial ordering can each contribute.

Read protection claims carefully

An application's routing or transaction-submission method may aim to reduce exposure. Check the provider's current documentation for the networks and transaction types covered, and for any additional trust assumptions.

A “protected” label is most useful when it explains what is protected and under which conditions. Do not infer that every unfavourable execution was an attack, or that every transaction on a protected route is guaranteed an ideal price.

For broader market mechanics, read Leverage and Liquidity.

Cover: original AI-generated conceptual illustration.