Skip to content
Crypto.world

Research

How to Serve Your Sandwich? MEV Attacks in Private L2 Mempools

Sandwich attacks — where a bot buys before a victim's swap and sells after it — are known to be common and profitable on Ethereum L1. Many rollups have tried to block them by removing the public…

How to Serve Your Sandwich? MEV Attacks in Private L2 Mempools
arXiv
2601.19570
Published
2026-01-27
Authors
Krzysztof Gogol, Manvir Schneider, Jan Gorzny, Claudio Tessone

AI summary

Overview

Research area: Blockchain security and decentralized finance — Maximal Extractable Value (MEV), specifically sandwich attacks on Ethereum Layer-2 rollups that use private mempools.

Technical level: Intermediate. Readers benefit from familiarity with automated market makers (AMMs), slippage, and transaction ordering, but the paper's core arguments are presented with worked intuition.

Scope: A combined theoretical and empirical study of whether sandwich attacks are feasible, profitable, and prevalent on Arbitrum, Base, Optimism, Unichain, and ZKsync between January and September 2025.

What This Paper Is About

Sandwich attacks — where a bot buys before a victim's swap and sells after it — are known to be common and profitable on Ethereum L1. Many rollups have tried to block them by removing the public mempool and letting a centralized sequencer order transactions privately. The paper asks whether that defense actually works: it builds a model of when a sandwich would pay off, models how likely a bot is to get all three transactions into the same block without a builder market, and then measures real on-chain data across five major rollups.

Key Contributions

  1. Theoretical extension to concentrated liquidity. The authors derive an optimal front-run sizing rule for constant-product AMMs (the classical "half-the-victim" result, $V_f^\star = V_v/2$) and extend it to concentrated-liquidity AMMs such as Uniswap v3, showing that the optimum is piecewise quadratic — CPMM-like inside a tick, with discrete profit jumps when a trade is pushed across a tick boundary into thinner liquidity.

  2. An execution-feasibility model for private mempools. They formalize the probability that the front-run, victim, and back-run all land in the same batch and in the right order, as a function of block time, batching window, priority tips, and latency variance — covering both first-come-first-served (FCFS) and priority-gas-auction (PGA) sequencer policies.

  3. A strict empirical measurement on five rollups. Using Dune queries over swap event logs, they apply actor-linking heuristics that distinguish externally owned accounts, shared routers, and dedicated executor contracts, based on swap events rather than ERC20 token transfers — which the authors state is the first L2 sandwich measurement to do so.

  4. A demonstration that naive heuristics overstate sandwich activity. Over 95% of flagged triples fail economic consistency checks, median net profit-and-loss is negative on every chain studied, and sandwich efficiency remains below 0.05 per 100 transactions.

Main Findings

  • Private mempools make sandwiching probabilistic, not atomic. Without a builder market, attackers must rely on sequencer ordering, redundant submissions, and tip placement. For typical rollup parameters (block time $T_b \approx$ 200–500 ms, batching window $T_s \approx$ 300–800 ms, latency variance $\sigma \approx$ 50 ms), co-inclusion probabilities fall between 0.05 and 0.20 — far below the near-atomic inclusion possible on Ethereum L1.

  • Minimum viable victim size exceeds observed trades. With gas costs of roughly $0.20–$0.70 per attack and active-tick liquidity between $50k and $300k, the profitability threshold requires victim swaps generally above $1.5k–$3k. Median victim swap sizes in the data are typically $200–$1,200 — a factor of 2× to 10× too small.

  • Candidate triples do not scale like real sandwiches. On Base (50,952 triples, the largest sample), the median front leg is $2,230.5, the victim $1,224.0, and the back leg $2,157.7 — attacker legs are larger than the victim, contradicting the $V_f \approx V_v/2$ prediction. On Unichain (795 triples) the victim median is $3,045.4 versus $682.5 front and $546.8 back; on Arbitrum (2,576 triples) the figures are $807.1, $872.8, and $1,077.1.

  • Weak statistical signatures of genuine attacks. The share of "strong signature" cases (back-run within 10% of front-run size) is 24.6% on Arbitrum, 14.3% on Base, 5.1% on Optimism, 7.3% on Unichain, and 7.4% on ZKsync. Median back/front ratios are 1.035, 0.967, 0.728, 0.825, and 0.674 respectively, rather than clustering at 1.0. Front-to-back correlation is only 0.082 on Optimism and 0.398 on Unichain, with the highest case 0.627 on Arbitrum.

  • Median net PnL is negative on every rollup. Median gross PnL is on the order of $10^{-3}$ (for example, $0.000480 on Arbitrum and $0.001811 on Base). After slippage and gas, median net PnL is −$0.802645 on Arbitrum, −$2.227808 on Base, −$0.456947 on Optimism, −$0.652108 on Unichain, and −$0.441471 on ZKsync.

  • Flagged bots are mostly not sandwich specialists. Arbitrum has 96 flagged addresses and Base 169, but activity is extremely skewed: a single Arbitrum bot records 382,739 daily transactions, and a single Base bot accounts for 11,614 sandwiches. ZKsync shows only 7 addresses with 27 sandwiches total. Median sandwich efficiency is often below $10^{-3}$.

  • The illustrative L1 case is stark. In block 22029771 in March 2025, a trader swapping 220,000 USDC into USDT on Uniswap v3 received only about 5,000 USDT.

Methodology in Plain English

The authors work in two tracks that they then compare.

On the theory side, they treat a sandwich as three trades: a front-run buy, the victim's buy, and a back-run sell. They assume trades are small relative to pool liquidity — which they say holds empirically on rollups — and expand the AMM's swap formula to second order. That yields a simple quadratic profit expression whose optimum is to front-run with half the victim's size. They then adapt this to concentrated-liquidity pools, where liquidity is constant within a price tick but changes abruptly at tick boundaries, producing an alternative optimal strategy: size the front-run just large enough to push flow into a thinner tick.

For execution, they break the chance of a successful sandwich into multiplicative factors: the probability that front and back runs land in the same batching window, the probability that the sequencer's ordering rule places them around the victim (arrival-time based under FCFS, tip based under PGA), and a latency-noise term. Multiplying these gives a co-inclusion probability between 0.05 and 0.20 for typical rollup settings, which then feeds an expected-value formula and a minimum victim trade size.

On the empirical side, they pull all swap event logs with transactions and traces from Arbitrum, Base, Optimism, Unichain, and ZKsync for January through September 2025 via Dune. They first exclude single-transaction cyclic arbitrage that can mimic sandwich legs, then group swaps by blockchain, block number, and pool address (adding the currency pair for Uniswap v4, since v4 logs only show the router). Each transaction gets an "actor id": the sending address if the callee is a known system contract or widely used router, or the callee itself if it is a custom contract. A triple counts as a candidate only if actor id of the front and back legs match, differ from the victim's, indices are strictly ordered, and trade directions match the sandwich pattern. Finally, they check each candidate against the model's economic predictions and compute gross PnL, net-of-slippage PnL, and net-of-gas PnL.

Why This Matters

Impact on research. The paper argues that a common detection shortcut — pattern-matching three ordered swaps around a large trade, or attributing by ERC20 transfers — produces mostly false positives on L2s. It supplies an alternative identification scheme and a set of economic consistency checks, and it challenges the assumption that L1 sandwich economics transfer to rollups.

Real-world applications:

  • Rollup and sequencer design. Teams choosing between FCFS and PGA ordering, or between private and public mempools, get a quantified picture of how each choice affects the attacker's co-inclusion probability.
  • MEV measurement and analytics. Dashboards and research pipelines that label "sandwiches" on L2s can adopt the actor-linking and proportionality checks to avoid overstating activity.
  • DeFi user protection. The minimum-victim-size result identifies which trade sizes are actually at risk under current L2 conditions, which is useful for wallet warnings and slippage defaults.
  • Security auditing and monitoring. Distinguishing genuine victim-targeted ordering manipulation from benign arbitrage flow helps protocols triage alerts.

Industry relevance. The authors note that the absence of sandwiches on current L2s stems from private mempools and medium-value swaps rather than structural protections. As ecosystems move toward public mempools, order-flow auctions, or higher-value trades, the risk could return — making this a policy question for sequencing markets, not a solved problem.

Future Directions

  • Monitor sequencing market changes. If decentralized builders, order-flow auctions, or preconfirmation markets emerge, co-inclusion probabilities would rise and the feasibility frontier for sandwiching would shift; the authors call for continued measurement.
  • Extend coverage. The dataset covers the major rollups but may miss smaller venues or pools with different liquidity characteristics.
  • Study cross-block patterns. The analysis is restricted to same-block sandwiches; with sub-second block times, cross-block sandwiches are theoretically possible though empirically rare, and remain unmeasured here.
  • Refine attribution. Actor attribution relies on transaction-tree heuristics and may merge unrelated flows when aggregator contracts bundle multiple hops — a limitation that better tooling could address.

Target Audience

Researchers and practitioners working on MEV, rollup architecture, and sequencer design; blockchain data analysts building MEV detection pipelines; and protocol or foundation teams setting ordering and mempool policy. DeFi security auditors and quantitatively inclined traders will also find the profitability model directly useful. The paper assumes some comfort with AMM mechanics and probability, but its empirical results are readable without following the derivations.

Authors’ abstract

We study the feasibility, profitability, and prevalence of sandwich attacks on Ethereum rollups with private mempools. First, we extend a formal model of optimal front- and back-run sizing, relating attack profitability to victim trade volume, liquidity depth, and slippage bounds. We complement it with an execution-feasibility model that quantifies co-inclusion constraints under private mempools. Second, we examine execution constraints in the absence of builder markets:…

The full abstract on arXiv
Read the original paper