Skip to main content
TLDR:
  • Sandwich attacks front-run and back-run your transaction within the same bundle, extracting value at your expense.
  • Jito’s dontfront feature prevents this by ensuring your transaction must appear at index 0 in any bundle.
  • You add a pubkey starting with jitodontfront as a read-only account to any instruction, then send through Jito’s block engine.
  • Chainstack Warp transactions optimize for speed (bloXroute relay). Jito dontfront optimizes for protection. Choose based on your use case.

What is a sandwich attack?

A sandwich attack is when a searcher:
  1. Front-runs your swap by buying the same token before you, pushing the price up
  2. Your transaction executes at the inflated price
  3. Back-runs by selling immediately after, profiting from the price difference
This happens at the bundle level — the attacker places their transactions around yours in the same block. The result: you get worse execution, the attacker takes the difference.

How Jito dontfront works

Jito’s block engine processes transaction bundles. The dontfront feature is a simple opt-in:
  1. Add a pubkey starting with jitodontfront (e.g., jitodontfront111111111111111111111111111111) as a read-only account to any instruction in your transaction
  2. Send the transaction through Jito’s block engine endpoint (not a standard RPC)
  3. The block engine enforces that your transaction must be at index 0 in any bundle that includes it
Since the attacker’s front-running transaction can’t appear before yours in the bundle, the sandwich is impossible.
This feature requires sending transactions through Jito’s block engine, not standard RPC nodes. The Jito endpoint is https://mainnet.block-engine.jito.wtf/api/v1/transactions.

Get your own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Implementation

Prerequisites

The example is shown in both Solana JavaScript libraries — both are actively maintained, so use whichever fits your project. @solana/kit is the newer, tree-shakable, functional SDK; @solana/web3.js is the classic Connection/PublicKey API.

Add dontfront protection to a transaction

TypeScript

Chainstack Warp transactions vs Jito dontfront

Chainstack offers two transaction acceleration paths. They serve different purposes: Use Warp when you need to land first (you are the one competing for position). Use dontfront when you need to protect your execution price (others are competing against you). For reads (getAccountInfo, getBlock, etc.), always use your Chainstack Solana endpoint.

Tips

  • Jito tip amounts should be minimum 1000 lamports. For sendTransaction, use a 70/30 split between priority fee and Jito tip.
  • Pick tip accounts at random to reduce contention across the 8 Jito tip accounts.
  • When using sendBundle, dontfront transactions must be contiguous at the front of the bundle with overlapping signers.
  • dontfront is mainnet and testnet only — it does not work on devnet.

Additional resources

Last modified on July 2, 2026