Sandwich Attack

Sandwich Attack: Extracting Value from Your Trades

Sandwich attacks place trades before and after your transaction to manipulate prices and extract profit from your slippage. It’s like cutting in line twice – once in front of you and once behind you.

A sandwich attack involves placing a buy order immediately before a victim’s trade and a sell order immediately after to profit from the artificial price movement created by the victim’s transaction. The attacker extracts value through manipulated slippage.

How Sandwich Attacks Work

Front-running places a large buy order ahead of the victim’s purchase, artificially inflating the price before the victim’s transaction executes.

Back-running immediately sells the tokens at the inflated price after the victim’s purchase completes, capturing profit from the temporary price increase.

MEV extraction occurs as the attacker benefits from privileged information about pending transactions while the victim pays higher prices due to artificial slippage.

Infographic showing a sandwich attack sequence: normal price, front-run buy, victim’s inflated trade, and back-run sell for profit extraction

Real-World Examples

  • DEX trading on Uniswap and other AMMs frequently faces sandwich attacks during periods of high gas prices
  • Large swaps are particularly vulnerable as they create more price impact for attackers to exploit
  • MEV bots automatically detect profitable sandwich opportunities in mempool data

Why Beginners Should Care

Hidden tax on DeFi trading that can add 1-5% to transaction costs beyond visible slippage and gas fees, significantly impacting returns.

Protection strategies include using MEV-protected RPCs, private mempools, or protocols specifically designed to prevent sandwich attacks.

Market impact reduces overall DeFi efficiency as users pay more for trades while value gets extracted by sophisticated MEV operators.

Related Terms: MEV, Front-Running, Slippage, Back-Running

Back to Crypto Glossary

Similar Posts

  • Treasury

    Treasury: Protocol Fund ManagementA treasury is a fund controlled by cryptocurrency projects or DAOs for development, operations, and community initiatives. It's like a company's bank account that's managed by community voting instead of executives.A treasury refers to cryptocurrency funds held and managed by protocols, DAOs, or projects for operational expenses, development funding, and community initiatives. These…

  • Synthetic Asset

    Synthetic Asset: Creating Anything on Blockchain Synthetic assets are blockchain tokens that track the value of real-world assets like stocks, commodities, or currencies. They’re like financial derivatives but programmable and globally accessible. A synthetic asset is a tokenized derivative that tracks the price of an underlying asset without requiring direct ownership of that asset. Smart…

  • Bridge Aggregator

    Bridge Aggregator: Cross-Chain Route OptimizationBridge aggregators find the best routes for moving assets between blockchain networks by comparing multiple bridge options. They're like travel booking sites that find the cheapest flights across different airlines.A bridge aggregator is a service that compares multiple cross-chain bridge options to find optimal routes for transferring assets between different blockchain…

  • Voting

    Voting: Decentralized Decision MakingVoting in cryptocurrency enables token holders to participate in governance decisions that shape project direction and protocol changes. It's like being a shareholder who can vote on company decisions, except the company is a decentralized protocol owned by its users.Voting refers to the democratic process where cryptocurrency token holders express preferences on…

  • Governance Participation

    Governance Participation: Active Protocol InvolvementGovernance participation involves actively engaging in decision-making processes for cryptocurrency projects and protocols. It's like being an active citizen who votes and participates in community decisions.Governance participation refers to active involvement in protocol decision-making through voting, proposal creation, delegation, and other governance mechanisms. This enables community members to influence project direction and…

  • Layer Separation

    Layer Separation: Modular Blockchain ArchitectureLayer separation divides blockchain functionality into distinct layers that can be optimized independently. It's like having specialized departments in a company that each focus on what they do best.Layer separation refers to blockchain architectures that divide functionality into distinct layers such as consensus, execution, and data availability, enabling independent optimization and…