Home › Strategies › Solana Sandwich Attack: How It Works and Why It Is Contested
Solana Sandwich Attack: How It Works and Why It Is Contested
A Solana sandwich attack is when a bot places one trade just before your swap and another just after, pushing your price worse and capturing the difference. It uses bundles to keep the three transactions adjacent. It transfers value from ordinary traders to the bot operator, which is why it is contested.
The mechanics
An automated market maker prices a swap from pool balances. A large buy moves the price. A sandwich bot exploits this in three steps:
- Front-run. The bot buys the same token just ahead of your trade, raising the price.
- Your trade executes at the now-higher price, up to your slippage limit, pushing the price higher still.
- Back-run. The bot sells right after, at the elevated price, and keeps the difference minus costs.
You receive fewer tokens than you would have, and the gap is the bot’s gross profit. The terminology and the Ethereum version of the problem are covered in Ethereum.org’s MEV overview.
What is different on Solana
There is no public mempool in the Ethereum sense, so bots cannot simply read a pending queue. In practice, sandwiching has relied on getting visibility of transactions through infrastructure and on submitting ordered transactions as bundles, as discussed in our Jito bundles piece. Vendor material describes this history too: CryptoMEV Bot’s article on Jito says early features enabled sandwich attacks and that Jito later removed live mempool access after community pressure. That is the vendor’s account and should be checked against Jito’s own announcements. Practices and protections keep changing, so treat any description as a snapshot.
| Feature | Ethereum | Solana |
|---|---|---|
| Public pending pool | Yes | Not in the same form |
| Atomic ordering tool | Private relays and bundles | Jito bundles |
| Typical user defence | Private RPC, slippage limits | Slippage limits, protected sending |
| Victim signal | Adjacent trades in block | Adjacent trades in slot |
Who is hurt
The immediate victim is any trader whose swap is large relative to pool depth and has loose slippage. The cost is not a fee; it is a worse execution price. Over many trades, retail users lose small amounts that add up for the attacker. This is the reason some projects add protections and some wallets send transactions through protected routes.
Key takeaway: arbitrage keeps prices aligned and usually does not target a specific user. Sandwiching targets a specific user’s trade and takes value from it. The difference is why they are treated so differently.
The commercial side
Sandwich bots are sold. CryptoMEV Bot’s sandwich bot page describes software that monitors large swaps, places a front-run and a back-run, and simulates profit against gas before executing. It lists the same pricing as its other products: $1,999 one-time retail and enterprise from $50,000. It says the main risk is a failed attack costing fees and possibly the trade itself. It does not state any track record, supported chains, refund terms or how the strategy is treated legally, and it does not discuss the effect on the people whose trades are targeted. We mention it because readers search for these tools, not to recommend the strategy.
Ethical and legal view
Reasonable people disagree, but a few points are worth stating plainly:
- The strategy profits at the direct expense of other users.
- Laws on market manipulation and fraud may apply, and enforcement is evolving. We cover the picture in Is a Solana MEV bot legal?.
- Reputational risk is real. Wallets and protocols have responded to harmful MEV.
- Platform rules can change. Strategies that are possible today may be blocked tomorrow.
None of this is legal advice. Take advice in your jurisdiction before running such a strategy.
If you are a trader rather than a bot operator
You can reduce your exposure:
- Use tight slippage settings where trades still succeed.
- Split large trades into smaller ones, or use limit-style orders where available.
- Use wallets and routers that offer protected sending.
- Avoid thin pools for large swaps.
- Check your executions after the fact.
Our guide to avoiding MEV on Solana goes through these in detail.
If you are a bot operator
Cleaner strategies exist. Arbitrage and liquidations do not rely on worsening a specific user’s price. Whatever you choose, review the risks first, and do not count on a strategy that depends on a vulnerability that wallets and protocols are actively closing.
Putting numbers on the harm, conceptually
The harm from a sandwich depends on three things: your trade size, the pool’s depth and your slippage tolerance. In a deep pool, a modest trade moves the price very little, so the attacker has little to capture. In a thin pool, the same trade moves the price a lot. Your slippage setting caps the damage: a swap with a 1 percent limit cannot be pushed past that without failing, while one with a very loose limit can be pushed much further. This is why the practical advice is the same for every user: tight slippage, deep pools, smaller trades.
How defences have evolved
Over time, wallets, routers and infrastructure providers have added protections, and the public debate has changed what is acceptable. As noted above, the vendor’s own article on Jito says live mempool access was removed after community pressure. Check current announcements rather than relying on any single account, since this area changes quickly, and a strategy that worked last year may not work now.
The case for and against
| View | Argument |
|---|---|
| Critics | It takes value from users who did nothing wrong, undermines trust in decentralised markets and invites regulation |
| Defenders | It is a consequence of open ordering rules, users can protect themselves with settings, and removing it is hard |
| Practical middle | Reduce exposure with tools and settings, push for better defaults and avoid the strategy if you care about reputation or legal risk |
You do not have to settle the debate to decide your own behaviour. If you operate a bot, you can choose strategies that do not target users. CryptoMEV Bot’s Solana MEV bot page lists arbitrage and liquidation strategies that do not require sandwiching, and that is the page we would point curious readers to for an example of the broader product. If you are weighing products, our evaluation framework includes an ethics line for this reason.
A note on searching for these tools
Queries such as “sandwich bot for sale” attract scams as much as legitimate vendors. Anyone offering guaranteed profits from sandwiching, asking you to deposit into a contract, or asking for your key is a red flag, regardless of the strategy. Review the risks before you spend anything.
Frequently asked questions
What is a sandwich attack on Solana?
A bot places a trade before and another after your swap so your trade executes at a worse price, and the bot pockets the difference.
Are sandwich attacks legal?
It depends on jurisdiction and facts, and the law is unsettled. They are widely criticised as harmful to users. Seek local legal advice.
How can I tell if I was sandwiched?
Inspect your transaction in a block explorer. Look for trades on the same pool immediately before and after yours from the same actor.
Does slippage setting matter?
Yes. A high slippage tolerance gives more room to be exploited. Tighter slippage reduces exposure but can make trades fail.
Sources
- Jito Labs – Jito documentation – https://docs.jito.wtf/
- Ethereum.org – Maximal extractable value (MEV) – https://ethereum.org/en/developers/docs/mev/
- Flashbots – Flashbots Protect overview – https://docs.flashbots.net/flashbots-protect/overview