Definition
A sandwich attack is a trading manipulation pattern in which an attacker strategically places one transaction just before and another just after a targeted user’s trade. By doing this, the attacker intentionally increases or decreases the asset’s price so the victim’s order executes at a worse rate, creating extra slippage. The attacker then closes their second transaction to capture the price difference created around the victim’s trade. This behavior is most commonly associated with automated trading and mempool monitoring on decentralized exchanges, but the core concept applies to any environment where transaction ordering can be influenced.
As a concept, a sandwich attack sits alongside other forms of predatory trading that exploit order flow and execution mechanics rather than fundamental value. It relies on anticipating a pending trade, adjusting the market price in advance, and then reversing that adjustment once the victim’s order has gone through. The result is a transfer of value from the victim to the attacker, without the attacker taking conventional market risk for an extended period. The severity of the impact often depends on trade size, liquidity depth, and the sensitivity of the market to slippage.
Context and Usage
In crypto trading discussions, sandwich attacks are often referenced when analyzing execution quality, slippage behavior, and the fairness of transaction ordering. They are particularly relevant in environments where transaction sequencing can be influenced by fees or priority mechanisms, making certain users’ trades more exposed to manipulation. The term is used to describe a specific pattern of front-running and back-running around a single victim transaction, rather than general volatility or normal price impact.
Market participants may consider sandwich attacks when evaluating how reliably orders will execute near expected prices, especially for large trades or leveraged positions. The concept is also discussed in relation to how centralized venues, such as a CEX, differ from on-chain environments in terms of visibility of pending orders and susceptibility to this type of manipulation. In risk and strategy conversations, sandwich attacks are treated as a structural execution risk that can affect realized entry and exit prices, independent of broader market direction.