Maximal Extractable Value (MEV): Arbitrage, Sandwich Attacks, Flashbots & PBS
By NorwegianSpark Editorial — written with AI assistance and reviewed by the NorwegianSpark SA editorial team | Last updated: 2026-03-27
This article contains affiliate links. We may earn a commission at no extra cost to you. Full disclosure
The Dark Forest: Formal Definition & Taxonomies of Extractable Value
Maximal Extractable Value (MEV)—originally coined by Phil Daian et al. in the landmark paper "Flash Boys 2.0" as Miner Extractable Value—refers to the maximum value that can be permissionlessly extracted from a blockchain by block producers or searchers through the arbitrary inclusion, exclusion, and reordering of transactions within a block.
In a standard transparent decentralized ledger, transactions broadcast by users land in a public peer-to-peer transaction pool known as the Mempool. Because transaction ordering within a block is not strictly enforced by FIFO (First-In, First-Out) rules, any entity with the authority to construct blocks or outbid competing transactions via gas fees can manipulate execution sequence for financial gain.
MEV is broadly categorized into two structural archetypes:
- Benign / Cooperative MEV:
- Cross-DEX Arbitrage: Equalizing price discrepancies across decentralized exchanges (e.g., Uniswap vs. Curve) or between centralized exchanges (CEX) and decentralized exchanges (CEX-DEX arbitrage). This increases market efficiency and ensures global pricing consistency.
- Liquidations: Rapidly closing undercollateralized loans in money markets (Aave, MakerDAO) to protect protocol solvency.
- Malicious / Toxic MEV:
- Sandwich Attacks: Frontrunning a retail trader's large swap on an AMM to artificially inflate the price, followed immediately by backrunning the trade to sell at the elevated price, extracting the trader's entire allowed slippage tolerance.
- Generalized Frontrunning & Exploit Copying: Monitoring the mempool with automated bot listeners that detect profitable smart contract transactions or unverified exploit payloads, replacing the original caller's address with the attacker's address, and bidding higher priority fees to steal the opportunity.
Understanding the game-theoretic incentives of MEV is essential for smart contract auditors and protocol designers aiming to build resilient decentralized applications.
The Mathematics of a Sandwich Attack: Optimal Frontrun Sizing
A Sandwich Attack is an atomic three-transaction sequence targeting a victim transaction submitted with a positive slippage tolerance parameter :
- Transaction (Frontrun): The attacker swaps input token for token , shifting the pool reserve ratio and pushing the spot price up to the exact maximum limit tolerated by the victim's check.
- Transaction (Victim): The victim's swap executes at the worst possible allowable price, further pushing the price of token higher.
- Transaction (Backrun): The attacker immediately dumps all acquired token back into the pool for token , extracting profit in token and returning pool reserves to equilibrium.
Let a constant product AMM possess initial reserves with . The victim wishes to swap an amount with minimum acceptable output .
To maximize profit, the searcher calculates the optimal frontrun swap size by solving the optimization problem:
subject to:
The searcher solves this quadratic constraint on-chain or in off-chain Rust execution engines in microsecond response windows, perfectly extracting the full economic surplus of the victim's slippage parameter. If an attacker attempts to frontrun with too large of a size, the victim's transaction reverts, triggering an atomic simulation failure in the searcher bundle and canceling the attack.
Flashbots, MEV-Boost & The Off-Chain Auction Architecture
In the early days of Ethereum, searchers engaged in Priority Gas Auctions (PGAs)—bidding astronomical gas prices in the public mempool to secure earlier transaction slots. PGAs resulted in massive network congestion, wasted blockspace from failed reverting transactions, and severe validator centralization.
Flashbots resolved this chaos by introducing private mempool auction infrastructure and Proposer-Builder Separation (PBS).
The Flashbots MEV-Boost pipeline operates as follows:
- Searchers: Identify arbitrage or liquidation opportunities and compose private Searcher Bundles (lists of transactions that must execute atomically in a strict sequential order without being split or frontrun).
- Builders: Aggregate thousands of searcher bundles with normal transactions, running knapsack optimization algorithms to construct a complete, maximally profitable block. Builders submit their sealed blocks and bid values to Relayers.
- Relayers: Verify block validity, execution payloads, and bid guarantees. Relayers pass only the Block Header and bid amount to the elected validator.
- Proposer (Validator): Signs the header of the highest-bidding block via MEV-Boost without seeing the internal transactions, guaranteeing payment while preventing the proposer from stealing the searcher's MEV alpha.
By moving competition into off-chain sealed-bid auctions, Flashbots eliminated public mempool spam and created a transparent, democratized marketplace for MEV redistribution.
CEX-DEX Arbitrage & Latency Wars in High-Frequency Crypto Trading
While on-chain sandwich attacks dominate headlines, the largest dollar volume of MEV consists of CEX-DEX Arbitrage (arbitraging price differences between centralized spot/futures order books like Binance and decentralized AMMs like Uniswap).
CEX-DEX arbitrage operates under continuous price discovery:
- Off-chain prices on centralized exchanges fluctuate continuously with millisecond latency based on global order flow.
- On-chain AMM prices remain static until an on-chain transaction executes.
- At the start of every block slot, the AMM pool price is stale relative to the current CEX mid-market price.
- Top institutional quantitative trading firms (such as Wintermute, Jump Crypto, and Tower Research) deploy dedicated high-frequency trading infrastructure to execute the "first trade in the block" (top-of-block arbitrage), buying the underpriced on-chain asset while simultaneously hedging on Binance.
Because top-of-block inclusion is determined by builder auctions, CEX-DEX searchers bid up to of their gross arbitrage revenue directly to block builders, generating massive fee yields for validating nodes. High-frequency colocation near validator nodes and low-latency P2P gossip mesh connections have become paramount for competitive survival.
Future MEV Frontiers: Encrypted Mempools, SUAVE & Execution Tickets
As MEV extraction approaches billions in cumulative volume, cryptographic research is focused on minimizing toxic value extraction at the protocol layer:
- Encrypted Mempools (Threshold Decryption & Delay Encryption):
- Transactions are encrypted by the user using a distributed threshold public key before broadcast.
- The block proposer and consensus network commit to a strict transaction ordering while the transactions are completely encrypted.
- The decryption key is revealed only after the block order is finalized, making frontrunning and sandwich attacks cryptographically impossible.
- SUAVE (Single Unifying Auction for Value Expression):
- Developed by Flashbots, SUAVE is an independent, decentralized, developer-programmable plug-and-play execution environment for mempools and block construction across all chains, turning block construction into an open decentralized market.
- Execution Tickets (ePBS):
- Protocol-enshrined PBS that sells future block execution rights via on-chain lotteries or ticket auctions, decoupling consensus security entirely from block building dynamics.
These advanced cryptographic mechanisms ensure that while benign arbitrage continues to enhance market efficiency, harmful predatory extraction against regular retail users is systematically eliminated from the base protocol layers.
Quantifying LVR vs MEV & On-Chain Structural Protection Strategies
A crucial distinction in modern quantitative decentralized finance is the relationship between Maximal Extractable Value (MEV) and Loss-Versus-Rebalancing (LVR). While MEV encompasses all value extracted via ordering power (including liquidations and sandwich attacks), LVR specifically measures the structural cost paid by liquidity providers to external arbitrageurs who exploit price discovery lag between centralized books and decentralized pools.
Key strategies deployed by cutting-edge protocols to protect liquidity providers and retail traders include:
- RFQ (Request for Quote) & Intent-Based Routing: Platforms like UniswapX, 1inch Fusion, and CoW Swap replace continuous public AMM swaps with signed off-chain order intents. Professional fillers (solvers) compete in sealed Dutch auctions to provide the best execution price, absorbing inventory risk and entirely shielding retail users from public mempool frontrunning.
- Dynamic AMM Fee Hooks: Emerging v4 architectures adjust swap fees dynamically using on-chain volatility estimators. When external volatility surges, the pool widens its fee spread to extract revenue from toxic flow, redistributing MEV profits back to passive liquidity providers.
- MEV-Share and Rebate Redistribution: Relayers and private RPCs (such as MEV-Blocker) detect when a user's transaction creates backrunning opportunities (like liquidations or multi-hop arbitrage) and automatically return up to 90% of the builder's priority fee rebate directly to the user's wallet address.
## Frequently asked questions
How can a regular DeFi user protect themselves from sandwich attacks?
Users should use private RPC endpoints (such as Flashbots Protect or MEV-Blocker), set tight slippage tolerances (e.g. 0.1%), and utilize CoW Swap batch auctions.
Why do searcher bundles not revert if they fail?
Searcher bundles are submitted privately to builders with an atomic all-or-nothing requirement: if the arbitrage condition is not satisfied during simulation, the builder drops the bundle entirely, costing the searcher zero gas.
What percentage of MEV profits goes to validators vs searchers?
Due to fierce searcher competition in builder auctions, searchers typically bid 90% to 99% of their gross MEV profit to block builders, who pass the vast majority directly to validators.
Related reading
- AMM slippage tolerance and liquidity exploitation — See how searcher bots calculate precise frontrun swap quantities based on AMM bonding curve formulas.
- Proposer-Builder Separation in Proof of Stake — Review how MEV-Boost fits into the Ethereum consensus engine block production cycle.
## Sources
- Flash Boys 2.0: Frontrunning in Decentralized Exchanges (Daian et al., 2019) — arXiv
- Flashbots documentation: MEV-Boost and PBS — Flashbots
No contributor to this article holds a professional cryptography or security credential. Every technical claim above is sourced to primary protocol documentation rather than to personal authority — follow the sources and verify anything you intend to act on.
Not financial advice. Crypto assets are volatile and can lose value. This article describes how protocols work, not what you should buy.
Content on AICryptoCoin is for informational purposes only and does not constitute financial advice. Always do your own research and consult a qualified financial advisor before making investment decisions.