What is a sandwich attack on Solana, and how do you avoid one?

By Printed · · 5 min read

A bot buy and a bot sell squeezing your buy inside one block, next to a price step chart showing your fill above the price you expected

Short answer

A sandwich attack is a kind of MEV where a bot sees your swap coming, buys the same coin right before you, lets your trade push the price up, then sells right after you. You get fewer tokens; the bot keeps the gap. On Solana you cut the risk with tight slippage and an app that sends trades with MEV protection.

What is a sandwich attack on Solana, and how do you avoid one?

Short answer

A sandwich attack is a kind of MEV where a bot sees your swap coming, buys the same coin right before you, lets your trade push the price up, then sells right after you. You get fewer tokens; the bot keeps the gap. On Solana you cut the risk with tight slippage and an app that sends trades with MEV protection.

What MEV means

MEV stands for maximal extractable value: money someone can make by choosing the order of transactions in a block, or by slipping their own in. Some of it is normal market plumbing, like arbitrage bots keeping prices in line across pools. Sandwiching is the part that comes straight out of your trade.

How a sandwich attack works

The setup

Every swap you send has a slippage setting: the worst price you'll accept. Say you're buying $200 of a memecoin with 10% slippage. That tells the network you're fine paying up to 10% more than the quote.

The three trades

A sandwich bot that sees your transaction before it lands does three things in one go:

  • Front-run: it buys the same coin just before you, pushing the price up.
  • Your trade: you buy at the higher price, still inside your 10% limit, which pushes the price up again.
  • Back-run: it sells right after you, at the price you just pushed up.

The bot's profit is roughly the extra you paid. You still get your coin, just fewer tokens than the quote said.

Why Solana is different from Ethereum

On Ethereum, pending transactions sit in a public mempool anyone can watch. Solana doesn't have one in the same way, so sandwiches mostly happen when a transaction reaches a validator (or a party close to it) that is willing to reorder or insert trades. Solscan's guide notes Solana sandwiches usually happen within a single slot, with all three trades in the same block, though some spread across slots. Low fees also make each attempt cheap for the attacker.

How big is it?

Fact Detail Source, checked 2026-12-03
One bot's take, 2024 About $30 million from Solana users in two months Cointelegraph, June 2024
How sandwiches land on Solana Mostly single-slot: front-run, victim, back-run in one block Solscan
How MEV protection routes Skips validators statistically linked to sandwiching Helius Docs
Stake excluded by Helius MEV Protect Roughly 3 to 4 million SOL Helius Docs

The 2024 figure is old and from one bot, so treat it as a sense of scale, not today's number.

How to spot a sandwich on your own trade

Check the block

Open your trade's transaction on Solscan. Look at the swaps in the same block on the same pool. If one wallet bought right before you and sold right after, that's the pattern.

Compare quote vs. fill

If you got noticeably fewer tokens than the quote, and the coin wasn't moving hard at that second, a sandwich is one likely cause. Price impact from your own size is the other, which is why it helps to check it before you buy.

How to avoid sandwich attacks

Keep slippage tight

A bot can only push the price up to your limit. With 1% slippage there's little room; with 20% there's a lot. Jupiter's docs put it simply: too low and trades fail, too high and you're exposed to worse prices. On a coin with a deep pool, low single digits is usually plenty. On a launch curve moving fast you need more, which is exactly when sandwiches pay best for bots.

Printed sets slippage automatically from the route you're getting: tighter on deep pools, wider on launch curves, never above 10%. The trade is still held to the minimum shown on your screen.

Send through MEV protection

How your transaction reaches the network matters as much as the setting. Helius's MEV Protect watches known sandwich bots and flags validators where sandwiches land in their blocks or the blocks next to them, then routes transactions around those validators. Printed sends trades with Helius MEV protection and fast landing. Fewer slots waiting also means fewer chances to get caught.

Size your trade to the pool

Big trades in thin pools have high price impact, and high impact plus wide slippage is the best setup for a bot. Check price impact before you buy. If it's high, buy less.

Avoid the busiest seconds

The first minutes after a coin starts running are when bots are most active and slippage needs to be widest. You don't have to sit out, but know that's when the cost is highest.

What a sandwich can and can't do

A sandwich attack can't take your coins, drain your wallet or touch your keys. It can only make one trade fill worse, up to the slippage you allowed. That's still real money on every trade, which is why the slippage setting and the way your trade is sent are worth caring about.

No app can promise zero MEV. What you can do is give bots less room and fewer paths. Memecoins are high risk on their own; there's no reason to hand extra to a bot on top.

FAQ

Can a sandwich attack steal my wallet? No. It only makes your trade fill at a worse price, up to your slippage.

How do I know if I got sandwiched? Open the transaction on Solscan and check the trades right before and after yours in the same block.

Does lower slippage stop sandwich attacks? It limits what a bot can take. Too low and your trade fails on fast coins.

Does Printed protect against sandwich attacks? Printed sends trades through Helius with MEV protection and sets slippage from the route. That removes the most common path; no setup promises zero risk.

Keep reading

Trade with protection on by default

Printed sends every trade with MEV protection and fast landing, shows the minimum you'll receive, and you slide to confirm. Your keys stay yours. 18+ only. Download Printed.

Sources

Questions

Can a sandwich attack steal my wallet?

No. A sandwich doesn't touch your wallet or your keys. It only makes your trade fill at a worse price, up to the slippage you allowed.

How do I know if I got sandwiched?

Open your transaction on a block explorer like Solscan and look at the trades in the same block right before and after yours. The same wallet buying just before you and selling just after is the pattern.

Does lower slippage stop sandwich attacks?

It limits how much a bot can take, because the bot can only push the price up to your limit. Too low and your trade fails on fast coins, so it's a balance.

Does Printed protect against sandwich attacks?

Printed sends trades through Helius with MEV protection, which routes around validators linked to sandwiching, and sets slippage automatically from the route. No setup can promise zero risk, but it removes the most common path.

Sources

Tags: mev, sandwich attack, slippage, solana

Keep reading

Trade it on Printed.

Live Solana memecoins, five checks on every coin and one-tap buys from your own wallet. 0.5% per trade, shown before you confirm. iPhone, Android and web.

Download on the App StoreGet it on Google Play

Open the web app · Meme coin trading app · How to buy meme coins · Get the app

Memecoins are highly risky and most lose value. Adults only (18+).