What is MEV?
In short
MEV (maximal extractable value) is the extra value that can be extracted by including, excluding or reordering transactions in a block, beyond the usual rewards and fees.
Think of a checkout line where someone knows what you are about to buy and can cut in front of you, profiting from the order in which people are served. On a blockchain, the order of transactions can also have economic value. That is what MEV, or maximal extractable value, describes.
On many networks, transactions wait in a public waiting area, the mempool, before being included in a block. Specialized bots scan it for profit opportunities and try to secure a specific execution order. Those who build or propose blocks can take part in the process, as can independent opportunity hunters known as searchers. The execution order doesn’t necessarily follow the order of submission.
How a sandwich attack works
Imagine you send a token purchase to a decentralized exchange (DEX). A bot spots the pending transaction and places its own purchase ahead of yours, pushing up the price in the liquidity pool. This jumping ahead is called front-running. You buy at a higher price, and the bot sells right after, aiming to profit from the price move.
Your transaction sits between the attacker’s two transactions, like the filling in a sandwich. Hence the name sandwich attack. To succeed, the attacker has to secure the right order, and the potential profit has to cover the execution costs.
Why it matters
For anyone using decentralized finance (DeFi) apps, MEV can mean a worse swap price or more competition for block space. But not every form of MEV is an attack. Exploiting price differences between markets, known as arbitrage, can help bring prices into line. We consider this distinction crucial: exploiting a price gap is one thing, and deliberately worsening someone else’s execution is another.
What to watch out for
A high slippage tolerance leaves more room for unfavorable execution and can make a sandwich attack easier. A very low tolerance, on the other hand, can cause the transaction to fail. There are private transaction submission services and MEV protection tools, but they don’t offer a blanket guarantee. Check exactly what they protect, who receives your transaction and what additional trust assumptions they introduce.