How Much Must a Private Mempool Hide? Exact Leakage Thresholds for Sandwich Attacks

Heikichi Hayashi, Li Jiazhuo, Ruoran LaiNeurIPS 2026

TL;DR

Encrypted blockchain waiting rooms (mempools) hide pending trades to stop predatory bots, yet metadata—like a rough range for the trade’s size—often still leaks. This paper derives an exact mathematical threshold for how much size leakage allows attackers to pull off guaranteed-profit "sandwich" attacks. Surprisingly, a privacy layer can reveal almost anything about a trade's size—including its upper bound—so long as it keeps the minimum possible size below one specific number.

What Problem Does This Paper Address?

On decentralized exchanges, Automated Market Makers (AMMs) set token prices deterministically using pool reserves (like Uniswap v2's classic $X \cdot Y = k$ formula). When pending orders sit in a public waiting room, predatory bots execute sandwich attacks: they buy right before a victim to drive up the price (front-run), let the victim buy at a worse rate, and immediately sell for a profit (back-run). Victims protect themselves with a slippage tolerance $\tau$, a guard that cancels their trade if the execution price drops too far.

To stop this, systems build private or encrypted mempools. However, hiding everything is hard; transaction interfaces or side channels often leak the token pair, trade direction, and a coarse interval $[\ell, u]$ for the trade size $q$. Prior work analyzed sandwiching when bots see the exact order. The authors ask: in the messy middle ground of partial privacy, how much leakage is enough to make sandwiching profitable?

Methods

The authors model a game-theoretic trading environment around a fee-free constant-product AMM:

  1. Interval Leakage: A victim submits a trade of hidden size $q$ with public direction and slippage tolerance $\tau$. A public signal leaks an interval $[\ell, u]$ containing $q$.
  2. Robust Admissibility: Predatory traders do not know $q$, so they require a robust front-run—one guaranteed not to trigger the victim's slippage guard for any trade size inside $[\ell, u]$.
  3. Execution Auction: Multiple risk-neutral traders bid in a first-price auction for the exclusive slot to sandwich the trade, facing a fixed execution cost $c$ (e.g., gas fees).

Rather than relying on simulations, the authors use algebraic monotonicity properties of the constant-product curve and pure-strategy Perfect Bayesian Equilibrium to solve the game in closed form.

Datasets

Not discussed in the paper. (This is a purely theoretical and analytical study).

Key Insights and Ideas

  • Small trades are the fragile ones: A given front-run hurts smaller victim trades proportionally more than larger ones. Consequently, if a front-run doesn't break the slippage guard of the smallest possible trade $\ell$ in the leaked interval, it won't break larger ones either.
  • The upper bound is irrelevant: Because both the safety constraint and the worst-case profit bind at $\ell$, the upper bound $u$ drops out of the math entirely. A privacy system trying to stop guaranteed-profit sandwiches can safely leak that a trade is "at most \$10 million," provided it doesn't leak a floor above the safety threshold.
  • One size rules them all: Because sandwich profit increases monotonically with both front-run size and victim size, the largest safe front-run for $\ell$ simultaneously maximizes worst-case, pointwise, and expected profit—regardless of the traders' probability beliefs over $[\ell, u]$.
  • Hiding direction vs. hiding size: If the trade direction is also hidden, no non-contingent front-run can exploit both directions at once (moving the price one way helps the opposite trade). However, even perfect pre-trade hiding cannot stop post-trade arbitrage once the trade alters public pool reserves.

Key Results

Guaranteed profit and bit-prefix leakage thresholds

Figure 1: (a) Guaranteed gross profit W of the optimal robust sandwich against the leaked lower bound ℓ, for slippage tolerances τ = 1% and τ = 0.5%, with execution cost c = 10−4X (dashed). A robust sandwich with positive net payoff at every consistent size exists exactly when ℓ> λc (Theorem 4.3); to first order λc ≈c/τ. (b) Leakage of the first d bits of the size, for sizes up to Q = 0.06X with τ = 1% and c = 10−4X. Shaded bins admit such a sandwich (Proposition 4.6); the unshaded range shrinks toward λc ≈0.0099X as d grows and always contains (0, λc].
  • Closed-Form Profit & Threshold: For a leaked lower bound $\ell$ and input reserve $X$, the optimal robust sandwich guarantees a worst-case gross profit of $W = \frac{\tau \ell(X + \ell)}{X + \tau \ell}$. A universally profitable robust sandwich exists if and only if $\ell$ exceeds an exact threshold $\lambda_c$. For small execution costs, this simplifies cleanly to $\lambda_c \approx c / \tau$. Halving your slippage tolerance $\tau$ roughly doubles the lower bound that can safely leak!
  • Concrete Scale: In a pool with $X = 10^6$ tokens, slippage $\tau = 2\%$, and execution cost $c = 100$ ($c/X = 10^{-4}$), the threshold is $\lambda_c \approx 4,976$ units. Leaking "the trade is at least 500 units" is safe; leaking "at least 5,000 units" invites a guaranteed-profit attack. If a system leaks the first $d$ bits of the trade size, any dyadic bin whose lower edge exceeds $\lambda_c$ becomes vulnerable (see Figure 1).
  • Auctioneer Takes All: With $m \ge 2$ symmetric traders, Bertrand-like competition forces the winning bid up to the exact expected net profit $R_s$. Traders earn zero net surplus in equilibrium, while the auctioneer (e.g., block builder) captures $100\%$ of the MEV rent.
  • Swap Fees Help Defenders: Adding a swap fee withheld from reserves strictly reduces sandwich profits, meaning the fee-free threshold $\lambda_c$ acts as a safe, conservative bound for system designers.

Limitations and Future Work

  • Single Victim: The clean one-dimensional threshold relies on isolating a single hidden order. Multiple same-direction trades, opposing flows, or cross-exchange routing introduce multi-dimensional state dependencies that remain open.
  • Specific AMM Curve: While the "smallest-victim-hurts-most" intuition likely generalizes, the exact algebraic cancellations depend on the $X \cdot Y = k$ curve (and Uniswap v3 only within a single active liquidity tick). Extending exact thresholds to Stableswap or tick-crossing piecewise curves is left for future work.
  • Exogenous Leakage: The paper treats the leakage map as fixed; strategically designing how information leaks over time turns this into an open information-design problem.

Summary updated

BibTeX
@inproceedings{hayashi2026how,
  author = {Heikichi Hayashi and Li Jiazhuo and Ruoran Lai},
  title = {{How Much Must a Private Mempool Hide? Exact Leakage Thresholds for Sandwich Attacks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=yuiJS0iLhX},
}
Figure