---
title: "How to Protect Transactions from MEV with Jito"
description:
  "Learn how to protect your Solana transactions from sandwich attacks using
  Jito's dontfront feature."
---

Sandwich attacks occur when searchers front-run and back-run your transaction
within the same bundle, extracting MEV 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.

<Callout type="warning">
  This feature is mainnet/testnet-only and requires sending transactions through
  Jito's block engine endpoint, not standard RPC nodes.
</Callout>

<CodeTabs storage="cookbook">

```ts !! title="Kit" file=packages/docs-examples/cookbook/transactions/mev-protection/kit.ts#region=dontfront

```

```rust !! title="Rust" file=packages/docs-examples/cookbook/transactions/mev-protection/rust/src/main.rs#region=dontfront

```

</CodeTabs>

<Callout type="info">
  Jito tip amounts should be minimum 1000 lamports. For sendTransaction, use a
  70/30 split between priority fee and Jito tip. Always pick tip accounts at
  random to reduce contention.
</Callout>

When using sendBundle, dontfront transactions must be contiguous at the front of
the bundle with overlapping signers. This ensures proper MEV protection across
the entire bundle.

For a deeper dive into sandwich attacks, bundle ordering rules, and tip
strategies, see the
[MEV Protection with Jito DontFront](/docs/defi/mev-protection) guide.
