
Essence
A sandwich attack represents a specific form of Maximal Extractable Value (MEV) exploitation, targeting decentralized finance (DeFi) users on automated market makers (AMMs). This attack pattern is a strategic manipulation of order flow where an attacker places two transactions around a victim’s pending transaction. The first transaction, known as the “front-run,” increases the price of the asset being purchased by the victim.
The second transaction, or “back-run,” returns the price to its original level or near it. The attacker profits from the price difference, effectively capturing the value of the slippage paid by the victim. In the context of crypto options, the attack is particularly potent because options prices are non-linear and sensitive to changes in underlying asset price and implied volatility.
A large options order can reveal information about market sentiment or cause a significant change in the options pool’s parameters. The attacker capitalizes on this information asymmetry and price impact. The attacker’s goal is not simply to execute a trade, but to exploit the predictable price movement caused by the victim’s transaction.
This attack vector highlights a fundamental tension between the transparency of on-chain transactions and the need for fair market execution.
A sandwich attack exploits the predictable price impact of a pending transaction by executing orders immediately before and after the victim’s trade, capturing the slippage as profit.

Origin
The genesis of the sandwich attack traces back to the transparent nature of the mempool in blockchain architectures like Ethereum. In traditional financial markets, order flow information is proprietary and highly valuable. However, on public blockchains, all pending transactions are broadcast to a shared mempool before being included in a block.
This creates an open-field environment where sophisticated actors, known as searchers, can monitor transactions and identify profitable opportunities. The attack evolved from simple front-running, where a searcher simply copies a pending transaction to execute it first. The sandwich attack is a more sophisticated iteration that maximizes profit by exploiting the price impact of the victim’s trade itself.
As decentralized options exchanges grew in prominence, searchers adapted their algorithms to target options AMMs. The non-linear pricing of options, governed by parameters like implied volatility and Greeks, provides a richer set of data points for searchers to exploit compared to simple spot token swaps. The attack became a significant source of MEV as options trading volume increased on-chain.

Theory
The theoretical foundation of a sandwich attack on options protocols rests on the predictable mechanics of options pricing models, particularly those used in AMMs. The core principle involves exploiting the relationship between trade size, liquidity, and price impact. The attacker calculates the exact price change a large order will cause based on the AMM’s specific pricing curve.

Options Pricing and Greeks
Options pricing models, such as Black-Scholes or variations adapted for AMMs, define the relationship between an option’s price and variables like the underlying asset price, time to expiration, and implied volatility. When a user executes a large option purchase or sale, the AMM adjusts its inventory and updates the option price based on the trade’s impact. The attacker’s bot calculates this impact before the transaction is confirmed.
The attack mechanism relies on several key elements:
- Slippage Tolerance: The victim’s transaction often includes a specified slippage tolerance, which defines the maximum price change they are willing to accept. The attacker’s front-run and back-run transactions are designed to execute within this tolerance, ensuring the victim’s transaction still completes at a disadvantageous price.
- Implied Volatility Manipulation: A large options purchase can increase the implied volatility parameter within the AMM pool. The attacker profits by buying the option before the victim’s trade at a lower implied volatility, then selling it after the victim’s trade at a higher implied volatility.
- Delta Hedging Dynamics: Options AMMs often maintain a delta-neutral position by dynamically adjusting their inventory. A large trade forces the AMM to rebalance. The attacker profits by anticipating this rebalancing and trading against the new, temporary price inefficiency.

Comparative Analysis of Trade Execution
The following table illustrates the financial dynamics of a sandwich attack compared to a standard trade.
| Transaction Type | Pre-Trade Price (P0) | Victim’s Price Impact | Attacker’s Actions | Final Price (P2) | Victim’s Profit/Loss | Attacker’s Profit/Loss |
|---|---|---|---|---|---|---|
| Standard Trade | 100 | Price increases to 102 | None | 102 | No loss from attack | 0 |
| Sandwich Attack | 100 | Price increases to 102 | Front-run at P0, Back-run at P2 | 100.5 (near P0) | Loss of slippage | P2 – P0.5 |

Approach
The execution of a sandwich attack requires sophisticated technical infrastructure and a deep understanding of market microstructure. Searchers utilize specialized bots to monitor the mempool continuously. These bots analyze incoming transactions to identify potential targets based on transaction size, gas fees offered, and the specific protocol being used.

Searcher’s Workflow
The searcher’s process involves several distinct steps:
- Mempool Surveillance: Continuously scan the mempool for pending options transactions that exceed a certain size threshold. The searcher identifies transactions with high slippage tolerance, indicating a user willing to pay a premium for execution.
- Profit Calculation: Simulate the impact of the victim’s transaction on the options pool’s pricing model. The searcher calculates the optimal front-run and back-run sizes to maximize profit while keeping the total gas cost below the potential gain.
- Transaction Construction: Create two transactions: a front-run transaction to execute before the victim, and a back-run transaction to execute after. The searcher must bid high gas fees for both transactions to ensure they are included in the same block, sandwiching the victim’s trade.
- Block Inclusion: Submit the front-run and back-run transactions to a validator or a private relay. The goal is to ensure the specific ordering of transactions within the block.
Searchers use sophisticated algorithms to calculate the optimal front-run and back-run transaction sizes, maximizing profit while staying within the victim’s acceptable slippage tolerance.

The Impact on Market Quality
Sandwich attacks reduce market quality by increasing the effective cost of trading for ordinary users. The attack creates a hidden tax on liquidity, as users consistently receive worse execution prices than anticipated. This erodes trust in decentralized exchanges and discourages large institutional orders from using on-chain options protocols.

Evolution
The evolution of sandwich attacks is characterized by an ongoing arms race between searchers and protocol developers. As searchers refine their techniques, protocols must implement new countermeasures to protect users and maintain market integrity.

Countermeasures and Mitigation Strategies
Initial mitigation strategies focused on private transaction relays. These relays, like Flashbots Protect, allow users to submit transactions directly to validators without exposing them in the public mempool. This eliminates the searcher’s ability to identify pending transactions.
However, searchers have adapted by developing new methods to identify and exploit transactions even within private relay environments. The next generation of countermeasures involves changes to market design:
- Batch Auctions: Protocols like CowSwap and Fjord implement batch auctions, where transactions are collected over a specific time period and settled at a single clearing price. This eliminates the concept of front-running by removing the linear ordering of transactions within a block.
- Dynamic Fee Structures: Some options protocols implement dynamic fees that adjust based on transaction size and price impact. These fees capture the potential MEV value and redistribute it to liquidity providers or the protocol treasury, reducing the searcher’s profitability.
- Request for Quote (RFQ) Systems: In RFQ models, users request a price from market makers, who provide a firm quote for execution. This eliminates the AMM-based price impact vulnerability by relying on off-chain pricing.
The arms race between searchers and developers has led to innovative market designs, moving beyond simple AMMs toward batch auctions and private relays to mitigate MEV.

Horizon
Looking ahead, the prevalence of sandwich attacks in options markets highlights a critical design challenge for decentralized finance. The future of options market design will prioritize mechanisms that ensure fair pricing and user protection over immediate execution speed. This requires a shift toward more sophisticated order flow management and a re-evaluation of the core principles of market transparency. The challenge lies in designing systems that maintain the benefits of decentralization while preventing exploitation by sophisticated actors. This involves creating new incentive structures that align the interests of searchers with the broader market. One potential solution involves protocols that capture MEV and redistribute it to users, transforming a vulnerability into a source of yield for participants. The systemic implications extend beyond individual protocols. The presence of sandwich attacks demonstrates a fundamental inefficiency in current blockchain architectures. The future will likely see a greater emphasis on solutions that obscure order flow or create entirely new mechanisms for price discovery that are less susceptible to front-running. The ultimate goal is to build a financial operating system where the integrity of price execution is guaranteed at the protocol level, not merely through user-side workarounds.

Glossary

Automated Market Makers

Smart Contract Security

Quantitative Finance Applications

Side Channel Attacks

Price Execution Integrity

Synthetic Attacks

Decentralization Challenges

Order Flow Exploitation

Defi






