> ## Documentation Index
> Fetch the complete documentation index at: https://www.helius.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MEV Protect: Route Around Sandwich Attackers

> Opt in to MEV Protect to route your Solana transactions away from validators statistically linked to sandwich attacks. Works with basic sends, bundles, and Helius Sender.

<Note>
  **This is an optional feature.** MEV Protect is off by default. You opt in per
  request by adding the `mev-protect=true` query parameter to your endpoint URL.
</Note>

## What is MEV Protect?

Sandwich attacks are a toxic form of MEV where a bot front-runs and back-runs your trade, moving the price against you and pocketing the difference. The front-run and back-run don't have to sit in the same block — with **wide sandwiching**, they can span multiple blocks over a longer window. What the attack really depends on is **access to your order flow** through a source that doesn't protect against sandwiching. Once a bot can see your pending trade, it can land its sandwich in any validator's block.

In practice, the party supplying that order flow is often a validator, and those validators frequently include the sandwiches in their own blocks to boost their rewards. That makes their blocks a disproportionate source of sandwiching.

MEV Protect reduces that risk at the routing layer. When you opt in, Helius avoids submitting your transaction to the validators statistically associated with sandwich activity, so it's far less likely to be sandwiched.

<CardGroup cols={2}>
  <Card title="Opt-In Per Request" icon="toggle-on">
    Off by default. Add `mev-protect=true` to the endpoint URL — no changes to
    your transaction or signing logic.
  </Card>

  <Card title="Works Everywhere" icon="arrows-split-up-and-left">
    Supported on basic `sendTransaction`, basic `sendBundle`, Sender Max, and
    Sender SWQOS-only.
  </Card>

  <Card title="Data-Driven Routing" icon="chart-line">
    Excludes validators that include sandwiches in their own blocks or in
    adjacent ones — only when the pattern is statistically significant.
  </Card>

  <Card title="Minimal Landing Impact" icon="gauge-high">
    Only a small fraction of total stake is excluded, so the effect on landing
    rate and latency is limited.
  </Card>
</CardGroup>

## How it works

Helius proactively monitors known sandwich bots and analyzes where their sandwiches land. A validator is flagged when either pattern holds consistently:

* **In its own blocks** — the validator includes the sandwich transactions directly.
* **In adjacent blocks** — sandwiches repeatedly land in the blocks immediately before or after the validator's.

To avoid penalizing validators for coincidental proximity, Helius only excludes those whose association with sandwich activity is **statistically significant**. This keeps the excluded set small and targeted rather than broadly blocking stake.

<Steps titleSize="h3">
  <Step title="Opt in">
    Add `mev-protect=true` to your endpoint URL. This applies to that request
    only.
  </Step>

  <Step title="Protected routing">
    Helius submits your transaction while avoiding leaders flagged for sandwich
    association, using the current statistically significant exclusion set.
  </Step>

  <Step title="Normal execution">
    Your transaction lands as usual — just with a much lower chance of being
    sandwiched.
  </Step>
</Steps>

## Supported sending methods

MEV Protect is a query parameter, so it layers onto every sending method without changing your request body.

| Method                                                                    | Endpoint                             | Enable with                              |
| ------------------------------------------------------------------------- | ------------------------------------ | ---------------------------------------- |
| [Basic `sendTransaction`](/sending-transactions/send-manually)            | `https://mainnet.helius-rpc.com`     | `?api-key=YOUR_API_KEY&mev-protect=true` |
| [Basic `sendBundle`](/sending-transactions/send-bundle)                   | `https://mainnet.helius-rpc.com`     | `?api-key=YOUR_API_KEY&mev-protect=true` |
| [Sender Max](/sending-transactions/sender-max) (transactions and bundles) | `https://sender.helius-rpc.com/fast` | `?mev-protect=true`                      |
| [Sender SWQOS-only](/sending-transactions/sender-swqos-only)              | `https://sender.helius-rpc.com/fast` | `?swqos_only=true&mev-protect=true`      |

## How to enable

Append `mev-protect=true` to the endpoint URL you already use. Combine it with any other query parameters (`api-key`, `swqos_only`, `rebate-address`) using `&`.

<Tabs>
  <Tab title="Basic sendTransaction">
    ```bash theme={"system"}
    curl "https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY&mev-protect=true" \
      -X POST \
      -H "Content-Type: application/json" \
      -d '{
        "jsonrpc": "2.0",
        "id": 1,
        "method": "sendTransaction",
        "params": [
          "BASE64_ENCODED_TRANSACTION",
          { "encoding": "base64", "skipPreflight": true, "maxRetries": 0 }
        ]
      }'
    ```
  </Tab>

  <Tab title="Basic sendBundle">
    ```bash theme={"system"}
    curl "https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY&mev-protect=true" \
      -X POST \
      -H "Content-Type: application/json" \
      -d '{
        "jsonrpc": "2.0",
        "id": 1,
        "method": "sendBundle",
        "params": [
          ["BASE64_SIGNED_TX_1", "BASE64_SIGNED_TX_2"],
          { "encoding": "base64" }
        ]
      }'
    ```
  </Tab>

  <Tab title="Sender Max">
    ```bash theme={"system"}
    curl "https://sender.helius-rpc.com/fast?mev-protect=true" \
      -X POST \
      -H "Content-Type: application/json" \
      -d '{
        "jsonrpc": "2.0",
        "id": 1,
        "method": "sendTransaction",
        "params": [
          "BASE64_ENCODED_TRANSACTION",
          { "encoding": "base64", "skipPreflight": true, "maxRetries": 0 }
        ]
      }'
    ```
  </Tab>

  <Tab title="Sender SWQOS-only">
    ```bash theme={"system"}
    curl "https://sender.helius-rpc.com/fast?swqos_only=true&mev-protect=true" \
      -X POST \
      -H "Content-Type: application/json" \
      -d '{
        "jsonrpc": "2.0",
        "id": 1,
        "method": "sendTransaction",
        "params": [
          "BASE64_ENCODED_TRANSACTION",
          { "encoding": "base64", "skipPreflight": true, "maxRetries": 0 }
        ]
      }'
    ```
  </Tab>
</Tabs>

<Tip>
  MEV Protect changes only where your transaction is routed. Keep your existing
  tip and priority fee requirements — for Sender, both a tip and a priority fee
  are still mandatory.
</Tip>

## Tradeoffs

Excluding validators means your transaction has slightly fewer leaders to land with. In practice the impact is small: only a limited amount of stake (roughly 3–4 million SOL) is excluded at any time, a small fraction of total network stake. For most flows the reduction in landing rate and the added latency are negligible.

<Warning>
  For the most latency-sensitive strategies where every leader matters, measure
  landing rate with and without `mev-protect=true` for your specific flow before
  enabling it in production.
</Warning>

## MEV Protect vs. Transaction Rebates

These are complementary features that address different parts of MEV:

* **MEV Protect** is defensive routing — it lowers the chance a sandwich attacker can extract value from your trade in the first place.
* **[Transaction Rebates](/sending-transactions/backrun-rebates)** are offensive — they pay you a share of the beneficial, post-trade backrun MEV your transaction creates.

You can opt into both on the same request by adding both query parameters.

## Related

<CardGroup cols={2}>
  <Card title="Helius Sender" icon="rocket" href="/sending-transactions/sender">
    Ultra-low latency, multi-path transaction submission with tip-based pricing.
  </Card>

  <Card title="Transaction Rebates" icon="coins" href="/sending-transactions/backrun-rebates">
    Earn a share of the MEV your transactions create, paid in SOL.
  </Card>

  <Card title="Send Transactions (Basic)" icon="paper-plane" href="/sending-transactions/send-manually">
    Build, optimize, and confirm a `sendTransaction` with a robust retry loop.
  </Card>

  <Card title="Send Bundles (Basic)" icon="layer-group" href="/sending-transactions/send-bundle">
    Atomic, all-or-nothing execution of up to 5 transactions via `sendBundle`.
  </Card>
</CardGroup>
