Crypto NationThe whole coin market as one nation🗺 Open the mapMap

In-depth essays · #16 / 50 · Architecture, Consensus & Upgrades

Inside MEV and Block Building: The Invisible Race to Order Transactions

From arbitrage and sandwich attacks to Proposer-Builder Separation (PBS) and TEE block building

Inside a single block, whether your transaction executes first or second can mean a difference of thousands of dollars. The profit that can be captured by reordering, inserting, or censoring transactions within a block is known as MEV (Maximal Extractable Value).

1. Constructive vs. Predatory MEV: Arbitrage vs. Sandwich Attacks

Much of MEV is essential market plumbing: arbitrage bots keep token prices aligned across DEXs, and liquidation bots keep lending protocols solvent when collateral drops.

Predatory MEV, however, hurts everyday users—most notoriously the sandwich attack, where a bot spots a pending swap in the public mempool, buys ahead of the user to push the price up, and sells immediately after in the same block.

2. Proposer-Builder Separation (PBS): Protecting Solo Validators

If solo home validators had to run sophisticated MEV search algorithms to stay competitive, validation would centralize around quant firms. Proposer-Builder Separation (PBS) solves this by letting specialized builders compete to assemble the most valuable block and bid for inclusion, while any home proposer simply accepts the highest-paying sealed block.

3. How L2 Districts Tackle MEV: Private Mempools and Verifiable TEEs

On L2s, Arbitrum uses a private, first-come-first-served sequencer feed so bots cannot front-run pending swaps, while Unichain builds blocks inside Trusted Execution Environments (TEEs) with verifiable priority ordering rules.

4. How Citizens Can Protect Their Swaps

Keeping slippage tolerances tight, using intent-based batch auctions, or routing mainnet transactions through MEV-protected RPCs keeps everyday swaps safe from front-running.

Related districts in the city

Related glossary terms

This essay is an explainer written to help you read the city; it is not investment advice. Facts on this page are as of 2026-10 and may change. If you spot a mistake, please tell us through the contact page.