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

  • Blockchain Trilemma

    Blockchain Trilemma: The Impossible TrinityThe blockchain trilemma describes the challenge of simultaneously achieving decentralization, security, and scalability in blockchain networks. It's like trying to be fast, cheap, and high-quality all at the same time.The blockchain trilemma refers to the fundamental trade-off between three key properties: decentralization, security, and scalability, where optimizing for two typically requires…

  • Wallet Signature Spoofing

    Wallet Signature Spoofing: Fake Authorization Attacks Wallet signature spoofing tricks users into signing malicious transactions that appear legitimate but actually authorize harmful actions. It’s like signing a contract where the fine print changes after you sign. Wallet signature spoofing involves presenting misleading information about transaction contents to trick users into signing authorizations for unintended actions….

  • Digital Currency

    Digital Currency: Electronic Money SystemsDigital currency refers to money that exists only in electronic form, including both centralized and decentralized varieties. It's like having money that lives entirely in computers and phones instead of physical bills and coins in your wallet.Digital currency encompasses all forms of money that exist exclusively in electronic format, including cryptocurrencies,…

  • KYC (Know Your Customer)

    KYC (Know Your Customer): The Identity Check KYC is crypto’s concession to traditional finance. Exchanges collect your personal information to comply with government regulations and prevent money laundering. Know Your Customer (KYC) is the process of verifying customer identities through government-issued documents and personal information. Most regulated cryptocurrency exchanges require KYC before allowing significant trading…

  • Collection

    Collection: Grouped NFT SeriesA collection is a group of related NFTs that share common themes, artwork, or attributes. It's like a series of trading cards or stamps that belong to the same set.A collection refers to a group of related NFTs that share common characteristics, themes, or attributes, typically created by the same artist or…

  • Market Manipulation

    Market Manipulation: Artificial Price ControlMarket manipulation involves artificially influencing cryptocurrency prices through coordinated trading, false information, or abusive practices. It's financial fraud adapted for the digital age.Market manipulation refers to illegal or unethical activities designed to artificially inflate or deflate cryptocurrency prices for personal gain. These activities harm other investors and distort natural price discovery mechanisms.How…