Robinhood Chain Sequencer Feed is live. Receive ordered blocks earlier with Node-required Ultra or Direct Ultra access.
Get Started
Sign in
Create Account
Trading bots & strategies

What is Sandwich Attack?

A sandwich attack places one trade before a target swap and another after it to profit from the target's price impact. The attacker typically opens and closes a position around the target, while the target receives worse execution within its permitted constraints.

By BlockRazor Updated

How does Sandwich Attack work?

The first trade changes pool pricing, the target executes against the changed state, and the second trade unwinds the attacker's position. Profit depends on liquidity, fees, size, and ordering.

What should trading bot developers know about Sandwich Attack?

Slippage limits constrain acceptable execution but do not eliminate all ordering risks. Private routing reduces exposure to some observers; it should not be described as universal protection against every sandwich route.

Sources & further reading

Definitions are editorial summaries of the sources below. Protocol behavior and provider policies can change; consult the linked documentation for implementation details.