arXiv:2609.31379cs.GTSep 2026

Manuscript Offprint

arXiv:2609.31379

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

Tingyi Lin, Jiazhuo Li, Ruoran Lai

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Private and encrypted mempools hide pending transactions to stop sandwich attacks and other forms of maximal extractable value (MEV), but what they hide is rarely everything: a transaction's pair, direction, and a coarse range for its size can still leak. How much leakage makes sandwiching pay? We answer exactly for a fee-free constant-product automated market maker, the pricing rule behind Uniswap v2. Traders observe an interval containing the victim's size and bid in a first-price auction for the right to sandwich it, and the winning front-run must keep the victim's trade executable at every size in the interval. The answer turns on the smallest size consistent with the leak. It alone determines the feasible front-runs, the largest feasible front-run is optimal for pointwise, expected, and worst-case profit alike, and the guaranteed profit has a closed form. When execution is costly, a privacy layer that wants to rule out sandwiches profitable at every consistent size may therefore reveal anything about the size except a lower bound above an explicit threshold; the upper end of the range is irrelevant. With two or more symmetric traders, every pure-strategy perfect Bayesian equilibrium of the auction hands the entire expected net rent to the auctioneer. If the direction is hidden too, no non-contingent first leg front-runs both possible directions, while post-trade arbitrage can survive even perfect pre-trade hiding.

“A fool uttereth all his mind: but a wise man keepeth it in till afterwards.”

– Proverbs 29:11 (King James Version)

1 Introduction

A hidden order has size q>0q > 0, but outside agents observe only a coarse public signal. When does such leakage suffice to support profitable predatory behavior in equilibrium? We answer this question exactly in the trading game induced by a constant-product automated market maker (AMM), a smart contract that exchanges two tokens at prices set by its reserves. The motivating examples come from hidden-order execution environments, but only the induced information structure enters the theorems.

If an adversarial trader knows that a latent order intends to buy token Y using token X, then a front-run purchase of Y raises that order's execution price and creates the standard sandwich pattern: trade in the latent order's direction, let the latent order move the pool further, and then unwind in the opposite direction. Under full observability, the trader may know the hidden order exactly. Our interest is the intermediate regime in which the trader sees only coarse information. Sandwiching remains common on Ethereum [28, 25] and is not confined to simple Uniswap v2 paths: McLaughlin, Kruegel, and Vigna identify 63,257 sandwich attacks among apparent arbitrages, including one whose manipulation and unwind route through both Uniswap v2 and v3 [23], and Bai et al. detect 60,946 sandwich events, multi-token routes included, in 210,000 Ethereum blocks [6].

†^{\dagger}Correspondence to: tingyi3@illinois.edu

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

(a)

Figure

(b)

Figure 1: (a) Guaranteed gross profit W of the optimal robust sandwich against the leaked lower bound ℓ\ell, for slippage tolerances τ=1%\tau = 1\% and τ=0.5%\tau = 0.5\%, with execution cost c=10−4Xc = 10^{-4}X (dashed). A robust sandwich with positive net payoff at every consistent size exists exactly when ℓ>λc\ell > \lambda_c (Theorem 4.3); to first order λc≈c/τ\lambda_c \approx c/\tau. (b) Leakage of the first dd bits of the size, for sizes up to Q=0.06XQ = 0.06X with τ=1%\tau = 1\% and c=10−4Xc = 10^{-4}X. Shaded bins admit such a sandwich (Proposition 4.6); the unshaded range shrinks toward λc≈0.0099X\lambda_c \approx 0.0099X as dd grows and always contains (0,λc](0, \lambda_c].

A round of our game has four steps. A victim submits a swap whose size is hidden, with a slippage guard that cancels the swap if its output falls too far below the honest output. A public signal then reveals an interval that contains the hidden size. Traders bid for the single right to surround the swap, with a front-run immediately before it and an unwind immediately after. The winner fixes its front-run size without learning the exact size, and the front-run must leave the swap executable at every size consistent with the signal.

Formally, a leakage map sends the hidden size qq to a public signal ss whose interval Is∋qI_s \ni q is either [ℓs,us]\left[\ell_s, u_s\right] with lower endpoint ℓs>0\ell_s > 0 or (0,us](0, u_s]. The victim's direction and slippage tolerance τ∈(0,1)\tau \in (0, 1) are public. Before bidding, every trader and the auctioneer observe the pool reserves (X,Y)(X, Y), the trading pair, the direction, τ\tau, and ss, but not qq, and they share a posterior μs\mu_s on IsI_s derived from a common prior. Bids may use only robustly admissible front-runs, which keep the victim's trade valid for every q∈Isq \in I_s.

Our first result characterizes the feasible front-runs and the profit they guarantee.

Theorem A (Admissibility, value, and threshold). Fix a leaked interval [ℓs,us][\ell_s, u_s] with ℓs>0\ell_s > 0.

(i) The robustly admissible front-runs form an interval [0,amax⁡(ℓs,τ)][0, a_{\max}(\ell_s, \tau)] whose endpoint is an explicit function of XX, τ\tau, and ℓs\ell_s alone.

(ii) The largest admissible front-run is the unique maximizer of pointwise, expected, and worst-case profit, and its worst-case gross profit is

τℓs(X+ℓs)X+τℓs.\frac{\tau\ell_{s}(X+\ell_{s})}{X+\tau\ell_{s}}.

(iii) With execution cost c≥0c \geq 0, a robustly admissible bundle with positive net payoff at every consistent size exists if and only if ℓs\ell_s exceeds an explicit threshold λc\lambda_c that depends only on XX, τ\tau, and cc.

Theorem A collects Theorems 4.1 to 4.3. Only the lower endpoint matters because a front-run hurts small victims most: the victim’s output after the front-run, as a fraction of its honest output, rises with its size (Lemma 5.1). For a half-open interval (0,us](0, u_s], parts (i) and (ii) hold with ℓs=0\ell_s = 0 for pointwise and expected profit, and with c>0c > 0 no such bundle exists (Corollary 4.4 with usu_s in place of QQ). Figure 1 plots the threshold and the effect of leaking the leading bits of the size.

Our second result prices the execution right.

Theorem B (Execution auction). Let m≥2m \geq 2 symmetric risk-neutral traders bid for the slot, and let RsR_s be the posterior expected gross profit of the largest admissible front-run minus the execution cost c. If Rs>0R_s > 0, every pure-strategy perfect Bayesian equilibrium awards the slot to that front-run at the payment RsR_s, so the auctioneer collects the entire expected net rent; if Rs<0R_s < 0, no equilibrium places a sandwich.

Theorem B is Theorem 4.5; the posterior enters only through RsR_s. With a positive execution cost, a signal that reveals no positive lower bound supports no guaranteed-profit sandwich, while post-trade arbitrage with gross profit up to q2/(X+q)q^2/(X + q) can survive (Corollary 4.4 and Proposition 4.7).

Sandwich attacks on AMMs have been studied analytically under full observability, most directly in Heimbach and Wattenhofer's sandwich game [16]. Under partial observability the lower endpoint of the leaked interval is the sufficient statistic: it alone determines robust admissibility, the optimal robust attack, and the exact profitability threshold, a leakage-aware analogue of the minimum profitable victim input in public-order-flow analyses [31, 30].

The baseline hides the size while the pair, the direction, and the slippage tolerance are public, and the public direction is a substantive assumption. If the direction may be either way and the first leg must be chosen before it is revealed, no non-null first leg front-runs both directions (Proposition 6.4); a hidden slippage tolerance instead reduces to its public lower bound (Proposition 6.5). Hiding the direction thus blocks the non-contingent robust sandwich studied here, and when the direction leaks while the size is only interval-revealed, ℓs\ell_{s} determines the exact threshold. The closed forms use the algebra of the fee-free constant-product invariant; Proposition 6.7 bounds the effect of swap fees in one direction, and Remark 6.10 discusses other pricing rules, for which we do not claim them.

References (53)