Solana Sandwich Attacks Explained: How They Work and How to Avoid Them

Understand sandwich attacks on Solana, why the lack of a public mempool does not remove MEV risk, and how to check execution controls.

MadeOnSol··Updated · 10 min read
Solana Sandwich Attacks Explained: How They Work and How to Avoid Them

Disclosure: This article contains affiliate links. If you sign up through them, MadeOnSol may earn a commission at no extra cost to you. This never affects our rankings, ratings, or reviews.

Sandwich attacks are a harmful form of maximal extractable value (MEV): an attacker trades before and after your swap to exploit the price movement. Solana has no shared public mempool, but that does not remove transaction-ordering risk. Solana's MEV protection guide describes the mechanism and one Jito-specific mitigation.

What Is a Sandwich Attack?

A sandwich attack is a form of MEV (Maximal Extractable Value) where an attacker places two transactions around your trade — one before (frontrun) and one after (backrun) — to profit at your expense.

Here's the sequence:

  1. You submit a swap: You want to buy Token X for 10 SOL on a DEX.
  2. Attacker frontruns: The attacker sees your pending transaction and submits a buy for Token X just before yours, pushing the price up.
  3. Your trade executes: You buy Token X at the now-inflated price, getting fewer tokens than expected.
  4. Attacker backruns: The attacker immediately sells the Token X they bought in step 2 at the higher price, pocketing the difference.

Your trade may execute at a worse price, within its allowed slippage. The attacker seeks to capture part of that difference after trading costs; the exact outcome depends on pool depth, route and fees.

A Concrete Example

Suppose you swap 100 SOL for a memecoin through a Raydium pool. These figures only illustrate the mechanics; they are not a measured incident:

  • Without attack: You'd receive 1,000,000 tokens at the current price
  • Attacker frontruns: Buys 50 SOL worth of the token, moving the price up 3%
  • Your trade: Executes at the higher price, you receive 970,000 tokens instead
  • Attacker backruns: Sells their tokens after your swap, seeking a profit after fees

You received 30,000 fewer tokens than the no-attack illustration. You cannot infer the attacker's exact profit or your counterfactual execution from these four numbers alone.

How Sandwich Attacks Work on Solana

Solana's architecture is fundamentally different from Ethereum's, which changes how sandwich attacks operate.

Why Solana Is Different

On Ethereum, there's a public mempool where pending transactions wait to be included in blocks. Attackers monitor this mempool, identify profitable trades, and pay higher gas fees to get their frontrun transaction included first.

Solana does not have a shared public mempool. Transactions are forwarded toward upcoming leaders instead of waiting in a common public queue. That narrows one observation route, but does not make pending flow invisible to every participant.

However, this doesn't make Solana immune to sandwich attacks.

How Attackers Find Targets on Solana

Despite no public mempool, attackers have several vectors:

1. Leader visibility: A block producer receives transactions and has some ordering discretion. This is one source of MEV risk.

2. Optimized transaction infrastructure: Searchers with direct validator connections or specialized infrastructure may observe some transaction flow. This is not equivalent to viewing a public mempool.

3. Bundles: Jito can process submitted bundles atomically in a specified order. Solana's documentation explicitly describes a potential sandwich bundle and Jito's jitodontfront mitigation. Neither a bundle nor a tip is automatically a safety guarantee.

4. Routing choices: The path from a trading interface or RPC provider to a leader affects who may see a transaction before confirmation. Ask a provider what protection it actually applies.

The Jito Factor

Jito's block engine accepts transactions and bundles, with tips involved in bundle selection. Its documentation describes jitodontfront, which requires a protected transaction to appear first in a Jito bundle. Jito states this mitigation applies to its block engine and does not guarantee protection against every ordering strategy.

The leader and submission path still matter. Treat any provider's “MEV protection” label as a feature to verify, not a promise of best execution.

How Much Are Traders Losing?

Do not assign a fixed loss rate without a defined dataset and method. The exposure of a particular swap depends on factors such as:

  • Trade size relative to pool depth: A large order in a shallow pool moves the price more than the same order in a deep pool. No universal SOL threshold identifies a safe trade.
  • Low-liquidity tokens are more vulnerable because smaller amounts of capital can move the price significantly.
  • Volatility and order flow: Launches and sudden price moves can make quoted execution stale quickly; this is not proof that every worse fill is a sandwich.

An on-chain investigation needs a specific route, expected quote, actual output, surrounding transactions and pool state before attributing a loss to a sandwich.

How to Protect Your Trades

1. Use Tight Slippage Settings

Slippage tolerance limits how far a swap may move from its quoted minimum output before failing. It constrains one avenue for extraction, but it is not an exact cap on an attacker's profit or your total execution cost. Tight settings may cause a legitimate swap to fail in a volatile market.

On Jupiter, inspect the live quote, minimum received, price impact and any automatic slippage setting before approving. Appropriate tolerance depends on the route and current liquidity:

  • Liquid pairs may support a tighter tolerance.
  • Thin or volatile pairs may require a wider tolerance to execute; that also allows a worse fill.
  • Any route should be judged against the displayed minimum received, fees and alternative quotes, not a universal percentage table.

If a swap fails its slippage check, the output moved below the allowed minimum. The failure does not by itself establish that an attacker was present.

2. Use MEV Protection Features

Trading interfaces may expose execution or anti-MEV controls; check the current settings for your specific route:

  • Jupiter: Check the current swap mode and its execution settings; do not assume that every route uses the same protection.
  • Photon: Review its current transaction and anti-MEV settings before using them.
  • BullX: Check the protection options displayed for the specific trade.
  • GMGN: Review the current execution controls and minimum output shown in its trade flow.

The phrase “MEV protected” can describe different routing and ordering controls. Check provider documentation for the feature you select, its supported transaction types, whether it is on by default, and its limits. Jito's own mitigation explicitly disclaims complete protection.

3. Split Large Trades

Instead of swapping 100 SOL in a single transaction, consider splitting it into smaller trades:

  • Compare a smaller test quote with the full-size quote before deciding.
  • If you split an order, recheck the quote before each part; liquidity and price can change between swaps.
  • Account for repeated fees, market movement and the possibility that several smaller trades reveal your intent.

Splitting can reduce the price impact of one execution in some pools, but it is not inherently safer or cheaper. Compare total expected output across routes and trade sizes.

4. Use Limit Orders

Jupiter offers order types with a specified execution price. Check the current product's fill rules, fees, partial fills and cancellation behavior before placing an order.

A price condition can prevent a fill below your stated minimum, but it does not guarantee a fill or eliminate every form of adverse execution and market movement.

5. Time Your Trades

Timing changes liquidity, volatility and competition. There is no reliable “safe hour” across every token and venue:

  • Compare live depth and quotes instead of using the clock alone.
  • Be especially cautious when a launch or announcement makes prices move rapidly.
  • A quiet pool may also have thin liquidity and worse price impact.

6. Use Private RPCs

An RPC provider affects transaction delivery, but “private” or “staked” does not by itself prove that an order cannot be observed or reordered. Ask whether a provider offers a documented anti-sandwich mechanism for the exact submission path you use.

If you build trading scripts, compare the documented submission options from providers such as Helius or Triton and verify their current terms and behavior. Test that your slippage and minimum-output checks are enforced on-chain.

Sandwich Attacks vs Other MEV

It's worth understanding where sandwich attacks fit in the broader MEV landscape:

MEV TypeMechanismImpact on You
SandwichFrontrun + backrun your tradeWorse price
FrontrunningCopy your trade before it executesWorse price
BackrunningArbitrage after a tradeEffect depends on the route and pool
LiquidationClose an undercollateralized positionLiquidation loss or penalty
JIT LiquiditySupply liquidity around a tradeEffect depends on venue design

Not every form of MEV has the same effect. A sandwich specifically uses your trade between an attacker's trades to worsen your execution and capture value.

The Future of MEV on Solana

The MEV landscape on Solana is evolving rapidly:

Validator and relay incentives: The ordering path and economic incentives can change. Review current policies from the infrastructure you rely on.

Ordering controls: Solana and Jito document jitodontfront for a specific bundle path. Its limits matter as much as its benefits.

Wallet and app controls: Interfaces may change their swap routing, slippage defaults and warnings. Recheck the actual settings before a large trade.

Measurement: Better transaction and pool analysis may make specific incidents easier to identify, but aggregate MEV estimates require transparent methods.

Final Thoughts

Solana's lack of a shared public mempool narrows one attack route, yet sandwiches remain possible. Do not assume a swap is protected merely because it is on Solana or sent through a fast RPC.

Compare quotes and pool depth, set a minimum received you can accept, inspect the execution controls for your route, and consider an order with a price condition when appropriate. Splitting a trade deserves its own quote and fee comparison.

After execution, compare the actual output to the quote and pool state. A worse fill is a reason to investigate, not automatic evidence of an attack.

Sandwich attacks affect trade execution. Malicious wallet approvals and phishing are different threats. Our guides on how wallet drainers can move your assets or obtain token permissions and spotting common Solana scams cover those risks.

For more on protecting yourself while trading on Solana, check out our MEV protection guide and wallet security checklist.

FAQ

Can I get sandwiched on Jupiter?

Yes. Jupiter's routing and execution options may reduce exposure on some paths, but no interface can guarantee that a swap cannot be sandwiched. Check the current mode, displayed minimum output and applicable protection before signing, especially for a large trade in a thin pool.

How do I know if I was sandwich attacked?

Inspect your transaction and surrounding pool trades on Solscan or Solana Explorer. A buy before and sell after yours can be a clue, but same-slot proximity alone is inconclusive. Compare amounts, wallets, pool route, timing and your quoted minimum; ordinary volatility or price impact can also explain a worse fill.

Are sandwich attacks illegal?

Rules depend on the jurisdiction, actors and conduct. This technical guide does not determine the legal status of a particular trade. Seek qualified local advice for a legal assessment.

Does using Jito tips protect against sandwich attacks?

A Jito tip pays for bundle selection; it does not by itself prevent a sandwich. Jito's jitodontfront is a separate mitigation for bundles through its block engine, with explicit limits. Keep an acceptable minimum output in the transaction.

Do higher priority fees or Jito tips make me less vulnerable to sandwich attacks?

Not on their own. Higher priority fees or tips can affect inclusion incentives, but they do not set your minimum output or eliminate ordering risk. Our breakdown of how Solana's base fees, priority fees, and Jito tips actually work explains the fee mechanics.

Tools mentioned

Compare features and read reviews.

Live health scores, average ratings, and direct links on MadeOnSol.

Build with MadeOnSol API

KOL tracking, deployer intelligence, DEX streaming, and webhooks. Free API key — 200 requests/day.

Start free
import { MadeOnSol } from "madeonsol";

// Get a free API key at madeonsol.com/pricing
const client = new MadeOnSol({ apiKey: "msk_your_key" });

const { trades } = await client.kol.feed({ limit: 10 });
const { alerts } = await client.deployer.alerts({ limit: 5 });
const { tools } = await client.tools.search({ q: "trading" });
npm install madeonsolFull API docs

Keep reading

More from the blog.

All Security
How to Protect Yourself from MEV on Solana: Sandwich Attacks, Front-Running & Tips (2026)

Trading

How to Protect Yourself from MEV on Solana: Sandwich Attacks, Front-Running & Tips (2026)

Understand sandwich risk, set price limits, compare routing options and measure execution costs without assuming a tip or private relay guarantees protection.

4 minMarch 20, 2026
How to Filter Bot Wallets Out of Your KOL List on Solana (2026)

Guides

How to Filter Bot Wallets Out of Your KOL List on Solana (2026)

Copying bots disguised as smart money is one of the most common and costly mistakes in Solana copy trading. Here's how to spot them on-chain, why popular trackers miss them, and how to clean your KOL list before it costs you.

10 minMay 31, 2026
OdinBot Review: Zero-Block Execution and 40% Lifetime Fee Share on Solana

Trading Bots

OdinBot Review: Zero-Block Execution and 40% Lifetime Fee Share on Solana

OdinBot is a web-based Solana copy trading bot that lands a measured share of trades in the same block as the leader wallet. We tested it, broke down the fee math, and explain the 40% lifetime referral split.

10 minMay 21, 2026
Solana Mempool Monitoring: Tools, Techniques & What Actually Works (2026)

Trading

Solana Mempool Monitoring: Tools, Techniques & What Actually Works (2026)

Solana has no traditional mempool, but pending transactions are still observable. Learn how Solana mempool monitoring works with Jito bundles, gRPC streams, leader TPU forwarding, and ShredStream — plus practical tools and use cases for MEV detection, frontrun protection, and latency optimization.

15 minApril 6, 2026
Solana Liquidity Explained: How AMMs, Pools, and Order Books Work

Guides

Solana Liquidity Explained: How AMMs, Pools, and Order Books Work

Understand how liquidity works on Solana including AMM pools, concentrated liquidity, order books, slippage, and impermanent loss. Learn how to check liquidity before trading and why it matters.

14 minMarch 27, 2026
Solana Program Security: Audit Checklist for Smart Contract Developers

Guides

Solana Program Security: Audit Checklist for Smart Contract Developers

Review account and authority validation, state transitions, token handling, deployment controls and the evidence an external audit should cover.

4 minMarch 22, 2026

Enjoyed this article?

Explore the live data.

Real-time KOL trades, Pump.fun deployer intel, and 1,200+ ranked Solana & Robinhood Chain tools — free to explore.

Open the KOL Tracker