Sandwich attacks are a tax levied on predictable, public mempool activity. They are a market inefficiency extracted by MEV bots because the standard transaction model broadcasts intent.
Why Sandwich Attacks Are a Symptom of DeFi's Naive UX
Sandwich attacks are not a law of nature; they are a predictable outcome of exposing user intent in public mempools. This analysis argues that naive transaction signing and a lack of privacy defaults represent a fundamental UX failure, creating a hidden tax that protocols like Uniswap and wallets like MetaMask have failed to solve.
Introduction
Sandwich attacks are not a security bug but a direct consequence of DeFi's naive, transaction-first user experience.
The root cause is UX: Users sign a transaction specifying exact parameters, which bots front-run and back-run. This is a design flaw in the public mempool model used by Ethereum and most L2s.
Contrast with intent-based systems: Protocols like UniswapX and CowSwap abstract execution. Users submit desired outcomes, not transactions, moving risk from the user to specialized solvers.
Evidence: Over $1.2B has been extracted from Ethereum via MEV since 2020, with sandwich attacks representing a dominant share, proving the cost of the status quo.
The Core Argument: UX as a Security Layer
Sandwich attacks are not a market inefficiency to be arbitraged; they are a direct consequence of DeFi's naive, transaction-centric user experience.
Transaction-centric UX is insecure by design. The dominant model forces users to sign precise, low-level transactions, exposing intent and execution details to public mempools. This creates a predictable, extractable signal for MEV bots.
The solution is intent-based abstraction. Protocols like UniswapX and CowSwap shift the paradigm from 'how' to 'what'. Users submit signed declarations of desired outcomes, which solvers compete to fulfill off-chain, eliminating frontrunning vectors.
Secure UX requires execution opacity. A user signing an intent for a token swap reveals no executable transaction. Solvers bundle and settle these intents in a way that obfuscates the user's action from the public until it is finalized, making sandwich attacks impossible.
Evidence: Over $1.5B in volume has been settled via intents on CowSwap, with zero successful sandwich attacks, proving the model's security superiority over traditional AMM transactions.
The Anatomy of a Naive Transaction
The standard DeFi transaction is a naive broadcast, exposing intent and inviting front-running.
The Problem: Public Mempool as a Hunting Ground
Broadcasting a signed transaction to a public mempool is like announcing your trade before executing it. MEV searchers with sophisticated infrastructure scan for profitable opportunities, primarily sandwich attacks.
- ~$1B+ in MEV extracted annually, with sandwiches a dominant share.
- Latency arbitrage: Searchers win by having faster node connections (~100-500ms advantage).
- Creates a negative-sum game for regular users, who pay inflated gas and receive worse prices.
The Symptom: The Inevitable Sandwich Attack
A sandwich attack is the direct economic consequence of naive UX. A searcher sees a large swap, front-runs it to drive up the price, and back-runs it to profit from the slippage.
- Two transactions are bundled around the victim's trade.
- Profit is extracted from the victim's slippage tolerance.
- Enabled by the atomicity of block building on chains like Ethereum, which Flashbots and others have turned into a marketplace.
The Solution: Intents & Private Order Flow
Instead of broadcasting a specific transaction, users submit a signed intent (a desired outcome). Solvers compete off-chain to fulfill it optimally, submitting only the final, settled transaction.
- UniswapX, CowSwap, 1inch Fusion are intent-based protocols.
- MEV is internalized as solver competition, often returning value to the user.
- Privacy: The user's exact strategy is never exposed on-chain until settlement.
The Infrastructure: SUAVE & the Future Mempool
The ultimate fix is architectural: a separate network for transaction processing. SUAVE (Single Unified Auction for Value Expression) is Ethereum's proposed solution—a decentralized mempool and block builder.
- Encrypted mempool: Transactions are hidden until execution.
- Optimal execution: Builders compete across chains for best price.
- Redefines the stack: Separates expression of intent (SUAVE) from execution (Ethereum, Arbitrum, etc.).
The Stopgap: Flashbots Protect & RPC Guardrails
While intents and SUAVE develop, practical protection uses private RPC endpoints. Services like Flashbots Protect route transactions directly to builders, bypassing the public mempool.
- No code changes required for dapps; it's an RPC endpoint swap.
- ~90%+ reduction in sandwich attack success for users of these services.
- Limitation: Centralizes trust in the RPC provider and builder network.
The Metric: Price Improvement as the Standard
The shift from naive transactions is measured by price improvement—the difference between the quoted price and the final execution price. This flips the MEV narrative from extraction to redistribution.
- CowSwap pioneered this with its batch auctions and surplus maximization.
- Intents turn cost into benefit: Solvers use MEV (e.g., arbitrage, liquidations) to subsidize user trades.
- The new UX promise: "Your transaction will execute at this price or better."
The Cost of Naivety: MEV Extraction by Type
Quantifying the direct user cost and systemic impact of common MEV strategies, highlighting how naive transaction submission enables extraction.
| Extraction Vector | Sandwich Attack | Liquidity Arbitrage | Liquidation Frontrunning | Long-Tail NFT Sniping |
|---|---|---|---|---|
Typical User Cost Per Tx | 1-5% of swap size | 0.05-0.3% of arb size | 5-20% of liquidation bonus | 100% of asset delta |
Primary Execution Venue | Public Mempool | On-Chain DEXs (Uniswap, Curve) | Lending Protocols (Aave, Compound) | NFT Marketplaces (Blur, OpenSea) |
Relies on Mempool Visibility | ||||
Requires Expiring Order Flow | ||||
Automation Sophistication | High (sub-ms latency) | Very High (gas optimization) | High (bundle construction) | Medium (event monitoring) |
Annual Extracted Value (Est.) | $300M - $1B | $500M - $2B | $100M - $300M | $50M - $150M |
Mitigated by Private RPCs (e.g., Flashbots Protect) | ||||
Mitigated by Intent-Based Solvers (e.g., UniswapX, CowSwap) |
From Problem to Symptom: The Path Dependence of Bad UX
Sandwich attacks are not a core protocol flaw but a direct symptom of DeFi's naive, transaction-first user experience.
Sandwich attacks are a UX failure. The core vulnerability is not the AMM's math but the user's exposed intent. Submitting a signed, public transaction to a public mempool is the root cause.
This is path dependence. The EVM's synchronous, transaction-based model defined the UX paradigm. Protocols like Uniswap V3 optimized for capital efficiency, not user protection, embedding this risk.
The symptom manifests in MEV. Bots on Flashbots protect bundles exploit this predictable intent. The user's goal—a simple swap—is trapped in a system designed for atomic state changes, not outcome fulfillment.
Evidence: Over $1.2B in MEV was extracted in 2023, with sandwich attacks a primary contributor. This is a direct tax on the transaction model, paid by every naive user.
Building a Better Default: The UX-First Anti-MEV Stack
Sandwich attacks are not a bug of AMMs, but a direct consequence of exposing naive transaction mechanics to users.
The Problem: The 'Public Mempool' UX Default
Every DApp defaults to broadcasting raw, readable transactions to a public mempool. This creates a zero-cost option for searchers to front-run user intent. The user's job is to express a trade, not to be a network security expert.
- Guaranteed Leakage: Intent is signaled ~12 seconds before execution.
- User as Prey: Forces retail to compete with $1B+ in specialized infrastructure.
The Solution: Private RPCs & Order Flow Auctions
Shift the default endpoint from a public mempool to a private transaction relay. This bundles execution with MEV redistribution, turning a leak into a rebate. Protocols like Flashbots Protect, BloxRoute, and CowSwap's solver network operationalize this.
- Intent Privacy: User orders are hidden until settlement.
- Value Capture: MEV is extracted and partially refunded to the user.
The Architecture: Intent-Based Abstraction
The endgame is removing transaction construction from users entirely. Systems like UniswapX, Across, and CowSwap let users sign a desired outcome (e.g., 'I want 1000 USDC for 1 ETH'). Professional solvers compete in a batch auction to fulfill it optimally.
- Gasless UX: User doesn't pay gas or manage slippage.
- MEV-Inclusive Pricing: Searchers bake optimal routing & MEV capture into the quoted price.
The Metric: Economic Finality Over Latency
DeFi's obsession with sub-second finality is a trap for retail. A better stack prioritizes economic finality—the guarantee that a settled transaction was the economically optimal path. This is achieved through batch auctions and proof-of-inclusion, as seen in Chainlink's CCIP and Across.
- Removes Time Games: Batch auctions neutralize latency-based front-running.
- Verifiable Outcome: Users get a cryptographic proof their order was filled fairly.
Steelman: Is This Just the Cost of Doing Business?
Sandwich attacks are not a bug but a direct consequence of DeFi's naive, transaction-based user experience.
Sandwiching is a tax on the standard transaction model. Users broadcast intent publicly via a mempool, creating a free option for searchers. This is a fundamental design flaw in the user-to-blockchain interface, not a temporary exploit.
The cost is systemic inefficiency. Every dollar extracted by MEV bots is a direct drain on user capital and a hidden fee on liquidity. This creates a misalignment of incentives between users and the network's infrastructure.
Compare intent-based architectures. Protocols like UniswapX and CowSwap abstract transaction execution, batching orders off-chain to eliminate frontrunning surfaces. This shifts the security assumption from user competence to solver competition.
Evidence: Over $1.2B was extracted from Ethereum users via MEV in 2023, with sandwich attacks comprising a significant portion. This quantifies the real economic cost of the status quo UX.
The Inevitable Shift: Intent-Centric Architectures
Sandwich attacks are not a bug of MEV, but a symptom of DeFi's naive transaction-based user experience.
Sandwich attacks are a UX tax. They exist because users must specify low-level transaction parameters like slippage and gas, creating predictable on-chain signals. This exposes intent to searchers who front-run and back-run the trade.
Transaction-based UX is adversarial. Users compete against the network itself. Protocols like Uniswap require users to be their own market makers, a role they are structurally unfit for. This creates a negative-sum game for retail.
Intent architectures invert the model. Users declare a desired outcome (e.g., 'get the best price for 1 ETH'). Specialized solvers like those in CowSwap or UniswapX compete off-chain to fulfill it, abstracting away execution complexity.
Evidence: CowSwap's solver competition has saved users over $250M in MEV since launch. This proves the economic viability of intent-based settlement over direct AMM interactions.
TL;DR for Builders and Investors
Sandwich attacks are not a security bug but a predictable outcome of DeFi's transparent, slow, and naive transaction execution model.
The Problem: Public Mempools Are a Free Lunch
Broadcasting a plain transaction to a public mempool is like announcing your trade to every competitor. This predictable, first-come-first-served model creates a zero-sum game where MEV is extracted from users.
- Frontrunning: Bots front-run your trade, buying the asset first to sell it back to you at a higher price.
- $1B+ Annual Extractable Value: This is the scale of the economic leakage from naive UX.
- User as Price Taker: The user always gets the worst price in the visible transaction sequence.
The Solution: Intent-Based Architectures
Instead of specifying how to execute (a transaction), users specify what they want (an outcome). This shifts competition from speed to optimization, neutralizing frontrunning.
- UniswapX & CowSwap: Solvers compete to fulfill the user's intent, offering better prices.
- Privacy: Intents are shared with a limited set of solvers, not the public mempool.
- Better Execution: Users get price improvements, not the worst price in a block.
The Enabler: Private RPCs & Order Flow Auctions
Infrastructure that separates transaction routing from block production is critical. Private RPCs like Flashbots Protect and order flow auctions (OFAs) create a market for fair execution.
- MEV-Share/SUAVE: Redistributes extracted value back to users and applications.
- Sealed-Bid Auctions: Solvers submit private bids, preventing predatory frontrunning.
- Builder Market: Separates block building from proposing, a core tenet of PBS.
The Future: Encrypted Mempools & Threshold Cryptography
The endgame is cryptographically guaranteed transaction privacy until execution. Projects like Shutter Network and FHE (Fully Homomorphic Encryption) are pioneering this.
- Pre-Execution Secrecy: Transactions are encrypted until included in a block.
- Threshold Decryption: A decentralized network decrypts transactions only after they are ordered.
- Eliminates All Frontrunning: Makes the mempool opaque, rendering speed-based MEV extraction impossible.
Get In Touch
today.
Our experts will offer a free quote and a 30min call to discuss your project.