Maximal Extractable Value (MEV) is the profit that block producers can extract by reordering, including, or excluding transactions within the blocks they produce.
Detailed Explanation
MEV occurs because block producers have the power to decide the order of transactions within a block. Specialized bots monitor the mempool for profitable opportunities, such as sandwich attacks (placing buy and sell orders around a large trade), arbitrage between DEXs, and liquidating undercollateralized loans. While some MEV strategies provide useful services like arbitrage that keeps prices aligned, others like sandwich attacks extract value directly from regular users.
Why It Matters
MEV represents a hidden cost of using DeFi protocols, as users may receive worse prices due to front-running bots. MEV has become a large business since DeFi began, and projects like Flashbots work to make it more open and reduce its cost to users. Users can protect themselves with private transaction pools or MEV-protection tools.
Key Considerations
Protect yourself from MEV by using private transaction pools like Flashbots Protect, MEV-resistant DEX protocols like CoW Swap, or limiting slippage tolerance on swaps. Understanding MEV helps explain unexpected price impacts on large trades and why transaction ordering matters in DeFi.
Example
A user submits a large swap on Uniswap. An MEV bot detects this pending transaction in the mempool, buys the token first to push the price up, lets the user's swap execute at the higher price, then immediately sells for a profit. This sandwich attack leaves the user with a worse price than they expected.
Related Terms
Frequently Asked Questions
Maximal Extractable Value (MEV) is the profit that block producers can extract by reordering, including, or excluding transactions within the blocks they produce.
MEV represents a hidden cost of using DeFi protocols, as users may receive worse prices due to front-running bots.
Use Flashbots Protect or MEV Blocker for private transaction submission. Trade on MEV-resistant platforms like CoW Swap. Set tight slippage limits. Break large trades into smaller amounts. These measures reduce the risk of sandwich attacks and front-running.