What is maximal extractable value (MEV)?
Maximal extractable value is the profit that can be made by choosing which transactions go into a block and in what order, beyond the normal fees and rewards.
Also called: MEV, miner extractable value
How it works
On many blockchains, pending transactions wait in a public pool before they are added to a block. Whoever builds the block can include, leave out or reorder them. Specialized bots, often called searchers, watch the pool for chances to profit and pay to have their transactions placed in a set order.
Some MEV is neutral or even useful, such as arbitrage that brings prices in line across exchanges, or liquidations that keep lending protocols healthy.
Why it matters for users
Other forms of MEV take value directly from ordinary users. In a sandwich attack, a bot sees a large trade on a DeFi exchange, buys just before it to push the price up, and sells just after. The user gets a worse price, and the bot keeps the difference.
Front-running works in a similar way: a bot copies a profitable pending transaction and pays more to have its own version go first.
Warning signs
- Trades that fill at the worst price your slippage setting allows.
- Your transaction placed between two trades from the same address in one block.
- Large trades in thin pools that see repeated losses to slippage.
How users and protocols reduce it
Users can set tight slippage limits, split large trades, and send transactions through private channels that do not expose them to the public pool. Protocols can use batch auctions or other designs that make order matter less. Because MEV bots also react to flash loan attacks and other exploits, MEV is a key part of how attacks play out on-chain.
Related terms
- Decentralized finance (DeFi)Decentralized finance (DeFi) is financial services such as trading, lending and borrowing that run as smart contracts on a blockchain instead of through a bank or broker.
- BlockchainA blockchain is a shared ledger that many computers keep in sync, where records are grouped into blocks and linked so that past entries are very hard to change.
- Flash loan attackA flash loan attack uses a large uncollateralized loan, borrowed and repaid within one blockchain transaction, to manipulate prices or exploit a flaw in a DeFi protocol for profit.
- Smart contractA smart contract is a program stored on a blockchain that runs automatically when called, holding and moving assets according to its code.
- Pump and dumpA pump and dump is a scheme where insiders push up the price of an asset with hype or false claims, then sell their holdings at the inflated price to later buyers.