What Is MEV in Crypto? Maximal Extractable Value Explained
MEV, short for maximal extractable value, is the profit that block producers, validators and trading bots can earn by choosing the order of transactions in a block, or by inserting their own. It is a hidden cost to ordinary traders on many blockchains, shown most clearly in sandwich attacks that worsen the price you get on a swap.
On a blockchain, someone decides which pending transactions go into the next block and in what order. When that choice can earn money, it creates MEV. The term began as “miner extractable value” on proof-of-work chains and became “maximal” because validators and other block builders can do the same.
MEV at a glance
| Stands for | Maximal extractable value (earlier: miner extractable value) |
| Who earns it | Block producers, validators, builders and specialized bots, often called searchers |
| Where it happens | Mostly on chains where pending transactions are visible before they are confirmed, such as Ethereum and Solana |
| Who pays | Ordinary traders, through worse prices and higher fees |
| Not always harmful | Some forms, such as arbitrage and liquidations, help markets work |
How MEV works
- You submit a transaction. For example, a swap on a decentralized exchange.
- It waits in a public queue. On many chains, pending transactions can be seen before they are included in a block.
- A bot spots a profit. It simulates what your transaction will do to the price.
- The bot pays for position. It offers a higher fee or a direct payment to the block builder so its transactions are placed before or after yours.
- The block is built. Your transaction is confirmed, and the bot has taken its profit.
Common types of MEV
- Arbitrage. A bot buys a token where it is cheap and sells it where it is dear, which brings prices on different venues back into line. This is usually seen as useful.
- Liquidations. Bots close undercollateralized loans and positions for a reward, which keeps lending markets solvent.
- Front-running. A bot sees your large buy waiting, buys first, and sells to you at a higher price.
- Sandwich attacks. A bot places one trade before yours to push the price up, lets your trade fill at the worse price, then sells right after. You pay the difference, which the bot keeps.
How to reduce the cost of MEV
- Set a sensible slippage limit. High slippage tolerance gives sandwich bots room to take more. See what slippage is in crypto.
- Use protected transaction routes. Some wallets and swap tools send transactions privately, so bots can’t see them in the public queue. Check what your wallet or app offers.
- Trade liquid pairs and moderate sizes. Large orders in thin pools are the easiest targets.
- Use limit orders where available. They fill only at or better than your price.
- Beware of fake front-ends. Always use the official site of the protocol, and be careful with token approvals, because a bad approval can let an attacker take your tokens. Revoke approvals you no longer need.
Worked example: a sandwich attack
This is an example with round, made-up numbers. Suppose a pool prices a token at 1.00 dollar and you place a swap that would buy 10,000 dollars of it with 2% slippage tolerance.
- A bot sees your pending swap and buys first, pushing the pool price to about 1.01.
- Your swap executes at the worse price. You are still inside your 2% limit, so it goes through, and you receive fewer tokens than the 1.00 quote implied.
- Your own purchase pushes the price up again, to about 1.02.
- The bot sells right after at the higher price and keeps the difference, minus its fees and what it paid the block builder.
With a 0.5% limit, step 2 would have failed, because the price moved more than you allowed. A failed swap costs a small network fee but avoids the larger loss.
Which situations expose you most
| Situation | Why it matters | What helps |
|---|---|---|
| Large swap in a small pool | Your trade moves the price a lot, so there is more to take | Split the order, or pick a deeper pool |
| High slippage setting | Bots can take up to your limit | Lower it, then raise only if the swap fails |
| Newly launched token | Thin liquidity, volatile prices | Smaller size, expect worse fills |
| Swap through a public queue | Bots can see it | A protected route if your wallet offers one |
How to check a swap before you confirm
- Look at the quote and the minimum amount you will receive after slippage.
- Compare the quote with the price shown on a second tool, if you have one.
- Check the price impact figure. A high impact on a small pool is a warning.
- Confirm only if the minimum received is a number you can accept.
MEV and order-book exchanges
Some trading venues are designed to give less room for this kind of ordering games, for example by running an on-chain order book with its own rules for ordering orders. Hyperliquid is one example of an on-chain trading venue, and our guide to how perpetual futures work covers the products it offers. We have not verified how any specific venue handles MEV, so read its documentation before assuming protection. All DeFi trading carries risk, including bugs, thin markets and, with leverage, liquidation. Only use money you can afford to lose.
What this means for you
MEV is part of the cost of using public blockchains, and it is mostly invisible: it shows up as a slightly worse price. Learn what a swap will cost, keep slippage tight and use protected routes where possible. For background on how this fits into on-chain trading, see what DeFi is.
To compare tools that route swaps, see the best DEX aggregators.
Common questions
Is MEV illegal?
It depends on the type and the country, and the law is unsettled in many places. Arbitrage is widely accepted. Sandwich attacks are controversial, and some have drawn legal attention. This page isn’t legal advice.
Can I tell if I was sandwiched?
Open your transaction in a block explorer and look at the transactions immediately before and after yours in the block. A buy before and a sell after, from the same address, is a sign.
Do all blockchains have MEV?
Any chain where someone chooses the order of transactions can have it. How much depends on the design, fees and tooling.
Does a failed swap mean I was attacked?
Not necessarily. A swap also fails when the price moves past your slippage limit for ordinary reasons. A failure at a tight limit is the setting working as intended.
Do small trades need to worry about MEV?
Less than large ones. Small trades leave little profit for a bot after its own costs, but a high slippage setting still gives a bot room to act.
Sources
- ethereum.org supports: MEV definition, examples such as arbitrage and sandwich trades, and its effects