🛡

How to Avoid Sandwich Attacks on Solana 2026

March 2, 2026 · 11 min read · by SolanaTools Team

Solana Logo Solana Bot Comparison

How to Avoid Sandwich Attacks on Solana 2026 — Protection Guide

Last updated: March 2026

By SolanaTools Team March 2, 2026 11 min read

If you have ever swapped tokens on Solana and noticed you received fewer tokens than expected, you may have been the victim of a sandwich attack. These invisible predators extract millions of dollars from unsuspecting traders every month, and most victims never even realize it happened.

Sandwich attacks are a form of MEV (Maximal Extractable Value) exploitation where automated bots manipulate the price of a token around your trade to profit at your expense. On Solana, where transaction speeds are measured in milliseconds, these attacks execute with surgical precision. This guide explains exactly how sandwich attacks work, how to detect them, and five practical strategies to protect your trades in 2026.

What Is a Sandwich Attack

A sandwich attack is a three-transaction sequence executed by an MEV bot that exploits your pending swap transaction. The name comes from the structure: the attacker places one transaction before yours and one transaction after yours, "sandwiching" your trade between theirs.

Here is how the economics work. Suppose you are swapping 10 SOL for a memecoin. The attacker's bot detects your pending transaction in the mempool. Before your transaction executes, the bot buys a large amount of the same token, pushing the price up. Your transaction then executes at this artificially inflated price — you receive fewer tokens than you would have without the attack. Immediately after your buy, the bot sells its position at the higher price, pocketing the difference. The attacker profits, and you end up with a worse execution price.

The amount lost per sandwich attack varies. On small trades (under 1 SOL), the loss might be negligible — a fraction of a percent. On larger trades (5+ SOL), the impact can be substantial — 1-5% of your trade value extracted by the attacker. Over many trades, these losses compound significantly.

The Scale of the Problem: MEV bots on Solana collectively extract an estimated $5-10 million per month from regular traders through sandwich attacks and other MEV strategies. This is not a theoretical risk — it is an active, ongoing extraction that affects every unprotected swap.

How Sandwich Attacks Work on Solana

Understanding the technical mechanics helps you appreciate why certain protection strategies work and others do not.

Step 1: Transaction Detection

MEV bots monitor Solana's transaction flow for pending swap transactions. They look at the mempool (the queue of unconfirmed transactions) and identify swaps on major DEXes like Raydium and Jupiter. The bot analyzes each pending swap to determine if it is profitable to sandwich — larger trades with higher slippage tolerance are the most attractive targets.

Step 2: Front-Running

Once a profitable target is identified, the bot constructs a buy transaction for the same token and ensures it lands in the same block but before your transaction. On Solana, this is accomplished through priority fee manipulation and direct relationships with validators. The bot's buy order drives the token price up before your trade executes.

Step 3: Victim Execution

Your swap transaction executes at the inflated price. Because you set a slippage tolerance (e.g., 5%), the swap succeeds even though the price has moved against you. You receive fewer tokens than you expected, and the difference becomes the attacker's profit margin.

Step 4: Back-Running

Immediately after your transaction, the bot sells its position. Your buy pressure (combined with the bot's front-run buy) pushed the price up, and now the bot sells into this elevated price. The price returns to approximately where it started, and the bot has extracted value from your trade.

Key Insight: The attacker's profit comes directly from your slippage tolerance. The wider your slippage setting, the more room the attacker has to manipulate the price around your trade. This is why slippage management is one of the most important protection strategies.

Signs You Have Been Sandwiched

Most sandwich attack victims never check, but detecting an attack after the fact is straightforward if you know what to look for.

  • Worse-than-expected execution: You received noticeably fewer tokens than the quote showed before you confirmed the swap. A small deviation is normal due to natural price movement, but a consistent 1-3% worse execution suggests MEV extraction.
  • Suspicious adjacent transactions: Check your transaction on a Solana explorer (Solscan or SolanaFM). Look at the transactions immediately before and after yours in the same block. If you see a large buy of the same token right before your swap and a large sell right after, that is the sandwich pattern.
  • Same wallet appearing before and after: The clearest indicator is seeing the same wallet address executing trades on both sides of your transaction. Some MEV bots use different wallets for front and back-running, but many use the same one, making detection trivial.
  • Unusually high price impact: If your trade shows a price impact of 3-5% when you expected 1%, the extra impact likely came from a front-running transaction that moved the price before your execution.

Protection Methods (5 Strategies)

No single protection method is perfect, but combining multiple strategies significantly reduces your exposure to sandwich attacks.

1. Use Private Transaction Routing

The most effective protection is bypassing the public mempool entirely. Private transaction routing sends your swap directly to block builders through private channels, making it invisible to MEV bots scanning the mempool. If the bot cannot see your pending transaction, it cannot sandwich it.

Several Solana trading bots now offer built-in private transaction routing. Axiom routes transactions through private RPC channels by default. This is the single most impactful protection measure available, and it requires zero configuration from the user — just use a bot that supports it.

2. Use Jito Bundles

Jito is Solana's MEV-aware block builder that allows users to submit transaction bundles. A bundle is a group of transactions that must execute together in a specific order or not at all. By submitting your swap as part of a Jito bundle, you ensure that no foreign transaction can be inserted between your bundle's transactions. This structurally prevents sandwich attacks because the attacker cannot place their front-run transaction before yours within the bundle.

Many advanced trading bots integrate Jito bundles automatically. The trade-off is a small tip paid to validators for bundle inclusion, typically 0.001-0.01 SOL. This is a negligible cost compared to the 0.1-1 SOL that a sandwich attack might extract from an unprotected trade.

3. Lower Your Slippage Tolerance

The wider your slippage tolerance, the more profitable you are as a sandwich target. If your slippage is set to 10%, a bot can move the price up to 10% against you and still have your transaction succeed. If your slippage is set to 1%, the bot can only extract 1% at most, making the attack less profitable and less likely to be attempted.

For most swaps on liquid tokens, 0.5-1% slippage is sufficient. For less liquid memecoins, you may need 2-5%, but try the lowest setting first and only increase if transactions fail. Every percentage point of slippage you add is potential profit for MEV bots.

4. Split Large Trades

MEV bots prioritize large trades because the profit from sandwiching a 50 SOL swap is 50x greater than sandwiching a 1 SOL swap. If you need to execute a large position, split it into multiple smaller trades over a few minutes. Each individual trade is less attractive as a sandwich target, and the combined execution often results in a better average price than a single large swap.

5. Use MEV-Protected Trading Bots

The easiest protection strategy is simply using a trading bot that handles MEV protection automatically. Modern Solana trading bots have integrated multiple anti-MEV measures — private routing, Jito bundles, optimized slippage, and smart order routing — into a single interface that protects every trade without requiring manual configuration.

Axiom protects every trade with private transaction routing and Jito integration. Zero configuration needed.

Read Axiom Review →

Which Bots Offer MEV Protection

Not all Solana trading bots take MEV protection seriously. Here is a comparison of how the major bots handle sandwich attack protection.

Bot Private TX Routing Jito Bundles Auto Slippage MEV Dashboard Protection Level
Axiom Yes (default) Yes Yes Yes Excellent
Trojan Yes Yes Manual No Good
Photon Partial No Yes No Moderate
BonkBot Partial No Manual No Basic
Jupiter (DEX) Optional No Yes No Moderate

Axiom leads in MEV protection because it was built with anti-MEV measures as a core feature, not an afterthought. Every transaction is routed privately by default, Jito bundles are used automatically for larger trades, and the platform even shows you an MEV protection dashboard so you can see how much value has been saved on your behalf.

Trojan offers solid protection with private routing and Jito support, though it requires more manual configuration. Photon and BonkBot provide basic protection but lack the comprehensive anti-MEV stack that dedicated platforms offer.

Slippage Settings Guide

Slippage configuration is the most accessible protection measure — every trader can adjust it regardless of which platform they use. Here are recommended slippage settings by token type.

High-Liquidity Tokens (SOL, BONK, JUP)

Use 0.3-0.5% slippage. These tokens have deep liquidity pools, so your trade should execute with minimal price impact. There is no reason to set high slippage on liquid tokens — doing so only invites MEV extraction.

Medium-Liquidity Tokens (Established Memecoins)

Use 1-2% slippage. Tokens with moderate liquidity need slightly more slippage tolerance to ensure execution, but 2% should be sufficient for most trades under 10 SOL. If your trade fails at 2%, consider splitting it rather than increasing slippage.

Low-Liquidity Tokens (New Launches, Micro-caps)

Use 3-5% slippage, but only if necessary. New memecoins and micro-cap tokens often require higher slippage due to thin order books and rapid price movement. This is where MEV protection through private routing becomes critical — if you must use high slippage, at least ensure your transaction is not visible to sandwich bots.

Never Set Slippage Above 10%: If a token requires more than 10% slippage to execute a swap, something is seriously wrong. Either the liquidity is dangerously thin, the token contract has unusual fee mechanics, or you are being manipulated. Walk away from any trade that requires extreme slippage settings.

Frequently Asked Questions

How much money do sandwich attacks steal from Solana traders?

Estimates vary, but on-chain data suggests MEV bots extract $5-10 million per month from Solana traders through sandwich attacks and related strategies. Individual losses range from negligible amounts on small trades to hundreds of dollars on large unprotected swaps. The cumulative impact over months of active trading can be significant — a trader executing 10 swaps per day with average losses of $2-5 per sandwich would lose $600-1500 per month to MEV alone.

Are sandwich attacks illegal?

Sandwich attacks exist in a legal gray area. In traditional finance, front-running is illegal and heavily regulated. In decentralized finance, there is no regulatory framework specifically addressing MEV extraction on most blockchains. The transactions themselves are technically valid — the attacker is simply submitting buy and sell orders, which anyone can do. Whether future regulation will address on-chain MEV remains an open question, but currently, your best defense is technical protection rather than legal recourse.

Do sandwich attacks happen on Pump.fun bonding curves?

Traditional sandwich attacks are less common on Pump.fun bonding curves because the bonding curve's deterministic pricing makes the attack economics different from DEX-based swaps. However, a related form of MEV — front-running on new token launches — is extremely common on Pump.fun. Bots monitor for new token creation and buy in before human traders, achieving better bonding curve positions. This is why using an auto-sniper with private transaction routing is critical for Pump.fun trading.

Can I recover money lost to a sandwich attack?

No. Once a sandwich attack executes on-chain, the transactions are final and irreversible. There is no mechanism to reverse or dispute a sandwich attack on Solana or any other blockchain. The only effective approach is prevention — using the protection strategies outlined in this guide to minimize the probability and impact of future attacks. Think of MEV protection as an ongoing hygiene practice, not something you apply retroactively.