~/notes / MEV and ordering
MEV Explained: Who Takes Your Money and How
Transaction ordering has value. The people who capture it are sophisticated, and the defences available to ordinary users are narrower than the explanations suggest.
Whoever decides the order of transactions in a block can extract value from that decision. That extractable value is what MEV refers to, and it is not a bug in any single protocol. It is a consequence of blocks being ordered lists.
The main forms
Arbitrage. The same asset trades at different prices on two venues. Someone buys on one and sells on the other within a single block. This is straightforwardly useful: it keeps prices aligned.
Liquidations. Undercollateralised positions can be closed for a reward. Competing to be the one who does it is also useful, because the protocol needs liquidations to happen.
Sandwiching. The harmful one. Someone observes your pending swap, buys the asset before you at a lower price, lets your trade push the price up, and sells immediately after. You receive a worse price and the difference goes to them.
Front-running. Observing a profitable transaction and submitting the same one with a higher fee to execute first.
Why it is hard to eliminate
Someone has to order transactions, and any ordering has value attached. Removing the extraction requires removing the discretion, and the proposals to do that carry their own trade-offs.
The current approach on Ethereum is separation: specialist builders assemble blocks and compete, validators select the highest-paying block through an intermediary. This does not remove extraction. It makes the market for it competitive, which channels more of the value to validators rather than to whoever has the fastest connection.
What actually protects an ordinary user
Slippage limits. The most important defence. A swap specifies a minimum acceptable output, and a sandwich attack that would push the price beyond it causes the transaction to revert. Setting a tight limit costs you occasional failed transactions and prevents the large losses.
Very wide slippage tolerances are how people lose substantial amounts on a single swap.
Private transaction routing. Sending a transaction directly to builders rather than broadcasting it publicly. Several wallets and services support this. It removes the public mempool exposure that sandwiching depends on.
For any swap of consequence, this is worth using.
Deep pools. The extractable value from sandwiching scales with how much your trade moves the price. In a deep pool, a modest trade moves it very little and there is nothing worth taking.
Not trading on-chain at all. Purchases matched inside an exchange are not exposed to this. There is no public pending state to observe and no block ordering involved.
The scale of it
Estimates of total extracted value run into billions of dollars cumulatively. The share of that taken from ordinary users through sandwiching, rather than from arbitrage between venues, is smaller and still substantial.
The distribution is uneven: a user making occasional small swaps in deep pools is barely exposed, while someone regularly swapping illiquid assets with wide slippage settings is exposed continuously.
The summary I would give
If you swap on-chain, set tight slippage and use private routing for anything substantial.
If you mostly buy and hold, this does not apply to you. Buying through exchanges that let you specify the network and withdrawing to your own wallet involves one on-chain transaction with no ordering value attached to it, which is the simplest possible exposure profile.
# Corrections and technical nitpicks are welcome. Send them over. They get published with the fix.