Sandwich attacks on Solana swaps, and how to avoid them
A sandwich attack is when a bot buys a coin just before your swap and sells it just after, so you pay a worse price and the bot keeps the gap. It can only take as much as your slippage setting allows. Keep slippage low or automatic, swap through a route that sends privately, and split big trades in thin pools.
What a sandwich attack is
Your swap is a trade against a pool. When you buy, the price in that pool goes up a little. A sandwich bot sees your swap before it lands and places two trades around it:
- The front slice. The bot buys the same coin first. That pushes the price up.
- Your swap. It now fills at the higher price, so you get fewer tokens.
- The back slice. The bot sells right after you, into the price your buy just pushed up.
The bot’s profit is roughly the difference you paid. Jupiter’s docs describe this as MEV, short for maximal extractable value: “strategies like front-running and sandwich attacks where bots exploit pending transactions.”
Nothing is stolen from your wallet. Your swap goes through. You simply receive less than the quote, and you may never notice.
Why your slippage setting decides the damage
Slippage tolerance is the least you agree to accept. If the quote is 10,000 tokens and slippage is 10%, your swap carries a floor of 9,000. Any fill above 9,000 counts as a success.
That floor is exactly what a sandwich bot aims at. It can push the price until your fill sits just above your floor. Push further and your swap fails, and the bot is left holding coins it bought for nothing.
| Quote | Slippage | Least you accept | Most a bot can squeeze out |
|---|---|---|---|
| 10,000 tokens | 0.5% | 9,950 | about 50 tokens |
| 10,000 tokens | 1% | 9,900 | about 100 tokens |
| 10,000 tokens | 5% | 9,500 | about 500 tokens |
| 10,000 tokens | 20% | 8,000 | about 2,000 tokens |
Simple arithmetic from the floor. Real pools also move on their own, so the bot gets less than this in practice.
This is why the Helius MEV report says sandwiches “exploit traders who place orders on AMMs or bonding curves with high slippage tolerances,” and names memecoin traders as the people most exposed, since they “tend to set high slippage tolerances when trading in illiquid, highly volatile assets.”
Jupiter says the same thing from the other side. Its FAQ lists “unreasonably high slippage (>20%) when unnecessary, leading to sandwich attacks” as one of the cases it looks at when someone asks for help after a bad Ultra trade.
Does Solana have a mempool?
Not a public one like Ethereum’s. But sandwiches still happen, because someone along the path sees your transaction before it is placed in a block.
The history matters here. According to the Helius report, in March 2024 Jito suspended its mempool feature, “sacrificing significant revenue in the process.” Sandwiching did not stop. The same report says private, permissioned mempools grew in its place, and that validator operators “have reported receiving lucrative offers to participate in private mempools.”
The scale is real. Helius, citing Jito’s own data, says one sandwich program ran 1.55 million sandwich transactions over 30 days (7 December to 5 January) for a profit of 65,880 SOL, about $13.43 million at the time, and that “nearly half of all sandwich attacks on Solana can be attributed to this single program.”
How to avoid being sandwiched
No setting makes you immune. Jupiter’s docs are direct about it: “MEV cannot be fully prevented on any blockchain.” What you can do is make yourself a poor target.
- Keep slippage low or automatic. A small gap leaves little to take. Jupiter’s Ultra Mode sets slippage with its Real-Time Slippage Estimator, and its FAQ calls values like 0.73% or 1.2% normal for pairs that are not stablecoins. Phantom says its automatic setting picks “the lowest value likely to succeed,” though it warns the automatic value can still be high on volatile or low-liquidity pairs.
- Use a route that sends privately. Jupiter’s risk page says Ultra Mode “includes built-in MEV protection through private transaction submission, which significantly reduces the risk but does not eliminate it.” Its Manual Mode “does not include MEV protection.” So switching to Manual just to force a high slippage removes protection at the same moment you widen the gap.
- Split big trades in thin pools. A large buy in a small pool moves the price a lot, which is both a bigger prize for a bot and a reason you need high slippage in the first place. Several smaller swaps, each with a tight limit, give a bot less to work with.
- Do not raise slippage to fix a failed swap in one jump. If a swap fails with slippage exceeded, retry with a fresh quote first, then go up one step. Our post on slippage tolerance exceeded walks through that in order.
- Look at the minimum received line. Before you sign, the swap screen shows the least you will get. If that number would upset you, the slippage is too high.
Jupiter’s own landing service, which it calls Jupiter Beam, is how Ultra keeps trades away from outside senders. Its Ultra V3 post says that “when using other providers, there is always a risk of front-running and sandwich attacks,” and that with Beam “the risk is not zero as validators still broadcast to the leader.” Jito offers apps a similar tool: a marker called jitodontfront that tells its block engine not to put other trades ahead of the marked transaction. Jito says it “may help reduce sandwich attacks but is not guaranteed to do so,” and that it applies only to its own block engine. Treat any protection claim as reducing the odds, not removing them.
Where the settings are
| App | Slippage | Protection |
|---|---|---|
| Jupiter (jup.ag) | Ultra Mode sets it for you; Manual lets you fix a number | Ultra sends privately; Manual has no MEV protection |
| Phantom | Auto by default, or your own from 0.1% to 30% | Its swap settings page does not mention MEV protection |
From Jupiter’s docs and Phantom’s help page, 3 December 2026.
Use the official sites only: jup.ag for Jupiter, and Phantom’s help page on swap settings for where Phantom puts these options.
How to tell if it happened to you
Open your swap on a block explorer and look at the trades in the same pool right before and right after yours. A sandwich looks like one wallet buying the coin just before you and selling it just after. If you received close to your minimum rather than close to the quote, that is the other sign.
There is no undo. A swap that landed is final, as our post on cancelling a Solana transaction explains. The fix is for the next trade: lower the slippage.
Swaps in Raven
Raven swaps any coin to any coin through Jupiter, from one wallet or many at once, with one review before anything is signed and each fee on its own line. Raven’s swap fee is 0.4%, free between two stablecoins. Raven is open to everyone: open Raven and make an account. See about Raven.
Questions
What is MEV on Solana?
MEV is the value bots get by placing their own trades around yours, such as front-running and sandwich attacks. On Solana it mostly shows up as sandwiches on swaps with high slippage.
What slippage is safe from sandwich attacks?
No number is fully safe, but lower is better. Automatic slippage in Jupiter’s Ultra Mode or Phantom’s Auto setting is the best start. Avoid going above 20% unless you know why you need it.
Did I lose money if I was sandwiched?
Yes, the difference between the price you should have got and the price you got. Your swap still went through and your wallet was not drained.
Does Jito still run a public mempool?
No. The Helius report says Jito suspended its mempool in March 2024. Sandwiches continued through private mempools.
Sources
A sandwich can only take what your slippage allows, so keep that number small.
Open RavenSee how Raven does it: Fees, Swap, Phantom fee calculator.