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

  • Buyback

    Buyback: Token Repurchase ProgramsBuyback refers to projects repurchasing their own tokens from the open market, often to reduce supply or return value to token holders. It's like a company buying back its own stock to increase the value of remaining shares.Buyback describes the process where cryptocurrency projects repurchase their own tokens from the open market…

  • Chain Split

    Chain Split: Blockchain Network DivisionA chain split occurs when a blockchain network divides into multiple incompatible chains, often due to disagreements about protocol changes. It's like a road splitting into different paths that can't be merged back together.A chain split refers to the division of a blockchain network into two or more incompatible chains, typically…

  • Transparency

    Transparency: Open Information AccessTransparency in cryptocurrency refers to the open, verifiable nature of blockchain data that allows anyone to inspect transactions and network operations. It's like having buildings made entirely of glass where you can see exactly what's happening inside every room.Transparency describes the property of blockchain systems that makes transaction data, network operations, and…

  • Smart Contract Royalties

    Smart Contract Royalties: Automated Creator Payments Smart contract royalties automatically pay creators a percentage every time their NFTs are resold. It’s like having a永続 commission that follows your work forever. Smart contract royalties are automated payment mechanisms built into NFT contracts that send a percentage of each resale back to the original creator. These payments…

  • Capitulation

    Capitulation: Market Surrender and Mass SellingCapitulation occurs when investors give up hope and sell their holdings en masse, often marking market bottoms. It's like throwing in the towel when everything seems hopeless.Capitulation refers to the point where investors abandon hope and sell their cryptocurrency holdings in large volumes, typically occurring near market bottoms after prolonged…

  • Economic Security

    Economic Security: Financial Incentive ProtectionEconomic security refers to protection mechanisms that use financial incentives and penalties to secure blockchain networks and protocols. It's like having a security system where guards are paid well for protecting property and fined heavily for allowing break-ins.Economic security describes protection mechanisms that use financial incentives, stake requirements, and economic penalties…