Market Integrity Playbook

DEEP DIVE Updated Mar 04, 2026

MEV Sandwich Attack Defense

Sandwich attacks are no longer an edge case for volatile markets—they are an expected background risk in public mempool execution. The objective for DeFi teams is not to eliminate MEV in theory, but to reduce user harm in practice through routing controls, policy guardrails, and fast operational response.

This guide focuses on infrastructure-driven risk and shows how execution, monitoring, and incident controls reduce blast radius.

Published: Reading time: ~5 min
Timeline of a sandwich attack lifecycle from victim transaction broadcast, attacker front-run and back-run inclusion, to post-trade containment actions by the protocol team.
Figure 1. Sandwich attack timeline: pre-trade controls lower exploitability, in-flight controls reduce loss, and post-trade response improves recovery and trust.

Why Sandwich Risk Is an Operations Problem?

Teams often treat sandwich attacks as an unavoidable byproduct of transparent blockchains. That framing is incomplete. While you may not control all block production dynamics, you do control your frontend defaults, route quality, transaction construction rules, and user safety communication. Those choices materially change harm outcomes.

In real environments, the biggest losses happen when three factors align: permissive slippage defaults, poor route simulation, and delayed detection of abnormal execution spreads. Attackers do not need deep protocol exploits when user-facing transaction paths are weakly governed. That is why sandwich defense belongs next to your core controls for wallet threat modeling and frontend infrastructure security.

What Should Teams Know About Attack Path Decomposition?

A sandwich attack has a predictable structure:

  1. Observation: attacker monitors pending transactions for a high-impact swap with exploitable slippage.
  2. Front-run: attacker transaction moves pool price before victim transaction executes.
  3. Victim fill: user executes at a worse price but still within tolerance.
  4. Back-run: attacker exits to capture spread and leaves victim with adverse execution.

Defense succeeds when you disrupt one or more of these phases. You can reduce discoverability, reduce exploitability, or reduce payoff. Strong programs work on all three.

What Should Teams Know About Control Layer 1: Policy-Based Slippage Governance?

Default slippage settings are governance decisions, not UX preferences. If your frontend silently permits broad tolerances, it is effectively approving a larger extraction budget for attackers.

Connect this directly to your oracle integrity controls. If pricing references are unstable, slippage policy should automatically move to conservative mode.

What Should Teams Know About Control Layer 2: Intent-Aware Routing?

Not all routes with the best quote are safest at execution time. Routing logic must account for execution fragility, not only estimated output. Mature teams score route candidates by both price and manipulability.

Routing Signal Risk Interpretation Control Action
Pool depth concentration Price can move sharply from moderate trade size Split route or deny route candidate
Historical slippage outliers Likely repeated targeting window Apply stricter max slippage and warnings
Mempool congestion stress Higher inclusion uncertainty and reorder risk Suggest private relay / delayed execution
Large notional trade Attractive extraction target Offer chunked execution path

Execution-aware routing lowers expected attacker payoff. That alone can push many opportunistic bots toward easier targets.

What Should Teams Know About Control Layer 3: Private Order Flow and Relay Hygiene?

Private transaction pathways can reduce public mempool visibility, but they are not a universal shield. Teams should treat them as one layer in a defense stack:

Operationally, this mirrors principles from incident response design: diversify critical pathways, monitor for drift, and predefine fallback actions before outages occur.

What Should Teams Know About Detection: Measure Harm, Not Just Events?

Many teams detect “possible sandwiches” but cannot quantify user impact quickly. Your monitoring should produce actionable severity metrics:

Tie alerts to a severity framework with response SLAs. If extraction exceeds threshold X for Y minutes, trigger policy lockdown mode and incident comms review. This discipline prevents “dashboard acknowledgment without containment.”

What Is the Practical First-Hour Incident Playbook?

When a sandwich wave is confirmed, speed matters. A practical first-hour runbook:

  1. Activate protective profile: tighten global slippage caps and high-risk route rules.
  2. Throttle vulnerable pairs: cap order size or temporarily disable execution paths with repeated extraction.
  3. Switch recommendation mode: prioritize low-volatility routes even if quoted output is slightly worse.
  4. Publish concise user advisory: explain temporary protections and safer execution options.
  5. Preserve evidence: archive affected transactions, route decisions, and mempool telemetry snapshots.

If your signing workflows are already disciplined, as covered in multisig signer OPSEC, emergency governance parameter changes become less error-prone under pressure.

What Should Teams Know About User-Facing UX That Actually Reduces Risk?

A lot of anti-sandwich UX fails because it is either too technical or too vague. Good UX is specific and timed:

Think of this the same way you approach signature safety prompts: informative friction at high-risk points beats passive disclosure pages users never read.

How Does Maturity Model for Sustainable Defense Work?

Most teams can move from Level 1 to Level 2 quickly, which materially reduces user harm. Level 3 is where defenses become operationally reliable under stress.

What Should Teams Know About Final Takeaway?

Sandwich attacks are best handled as an engineering plus operations discipline. Build pre-trade guardrails, route with manipulability in mind, detect impact in real time, and execute containment quickly when conditions degrade. Teams that treat execution integrity as a product feature—not just a backend optimization—protect users better and preserve long-term protocol trust.