> For the complete documentation index, see [llms.txt](https://chaincontext.gitbook.io/help-center/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chaincontext.gitbook.io/help-center/safety/mev-protection.md).

# MEV Protection

Route transaction broadcasts through a private RPC to avoid sandwich attacks, frontrunning, and JIT liquidation. On Ethereum mainnet, \~80% of transactions now use private RPCs.

## Configuration

In the write-block editor, set `rpcMode`:

| Mode               | Endpoint                       | Chains   |
| ------------------ | ------------------------------ | -------- |
| `public` (default) | Public RPC from project config | All      |
| `flashbots`        | `rpc.flashbots.net`            | Ethereum |
| `mevblocker`       | `rpc.mevblocker.io`            | Ethereum |
| `merkle`           | `mainnet.merkle.io`            | Ethereum |
| `blink`            | `rpc.blink.network`            | Ethereum |

The dropdown only shows options compatible with the selected network.

## Mode 1 (Classic) vs Mode 2 (Session keys)

* **Classic `build_unsigned_tx`**: the agent signs and broadcasts. `rpcMode` is **advisory** — passed as metadata so the agent's wallet can choose to route via the private RPC. Most MCP-compatible wallets honor it.
* **Session-key `session_key_exec`**: the server signs and broadcasts. `rpcMode` is **enforced** — the server substitutes the private RPC URL directly.

## Why it matters

On Ethereum, public mempool transactions are visible to MEV bots. Any swap, liquidation, or auction-eligible tx is a target for sandwiching. Private RPCs route the tx directly to block builders without exposing it publicly.

Simulation still uses the public RPC (for speed + consistency). Only `eth_sendRawTransaction` is routed privately.

## References

* [Flashbots Protect](https://docs.flashbots.net/flashbots-protect/overview)
* [MEV Blocker](https://mevblocker.io/)
