MEV and Transaction Ordering

Understand how transaction visibility and ordering can change execution.

Intermediate14 minReviewed August 30, 2026
Recommended first:Centralized Exchanges, DEXs, and AMMs. You can still continue with this lesson.

Mempools, arbitrage, front-running, sandwich attacks, priority fees, and mitigations.

By the end, you should be able to

  • Explain how transaction ordering can create extractable value.
  • Distinguish arbitrage, front-running, and sandwich patterns.
  • Identify execution assumptions and practical mitigations.
Worked example · illustrative values

Illustrative three-step sandwich

A simplified sequence shows how ordering can affect a user’s execution.

Before userBuySearcher transaction moves pool price
User swapHigher priceUser consumes changed pool state
After userSellSearcher transaction reverses part of the move

Value created by ordering and inclusion

Maximal extractable value (MEV) is value that can be captured by changing the order, inclusion, or exclusion of transactions within a block. Arbitrage can help align prices across venues, while other strategies can impose costs on users. “Maximal” describes the opportunity set, not a guarantee that any actor captures it.

A visible swap can change the next price

A pending transaction may reveal its intended trade and constraints before inclusion, depending on the network and submission path. A searcher may submit another transaction that changes the pool state first, follows the trade, or arbitrages a resulting price difference. The actual outcome depends on ordering, fees, liquidity, slippage limits, and competing transactions.

Reduce exposure without claiming certainty

  • Use an appropriate slippage limit and understand that a limit that is too wide increases execution risk.
  • Consider routing and submission methods that reduce public mempool exposure when appropriate.
  • Compare quoted and executed results, and treat unexplained ordering as evidence for investigation rather than proof of intent.
Keep the signal in context

What this does not tell you

  • MEV terminology and infrastructure differ across chains and protocols.
  • A transaction appearing before or after another does not by itself prove malicious intent.
  • Private submission, routing, or tighter slippage can reduce some exposure but cannot remove smart-contract, liquidity, or execution risk.
Practical exercise

Analyze a hypothetical swap

Trace execution risk without submitting a transaction or connecting a wallet.

  1. Choose a hypothetical DEX swap and record pool, order size, quoted price, and slippage limit.
  2. Draw the intended ordering and one alternative ordering.
  3. Name one observable result that would support each explanation and one limitation of the evidence.
Review execution concepts →
Three-question knowledge check

Check your understanding

1. What can MEV involve?

2. What is a sandwich pattern?

3. What does a slippage limit do?

Sources and next steps

Ethereum MEV documentation ↗Flashbots MEV-Boost overview ↗Order-book guide →DeFi Risk Checklist →Bid / Ask Analysis →