Skip to content

Integrating Flashbots Protect ‚Äč

Flashbots Protect is an RPC service that helps protect your users' Ethereum transactions from dangerous frontrunning attacks by submitting transactions to a private mempool that remains hidden from bots. You can also use the service to earn MEV refunds on any MEV realized through backrunning.

To integrate Flashbots Protect with Privy, first configure the Flashbots RPC URL for the chain your app needs:

import {mainnet} from 'viem/chains';

import {addRpcUrlOverrideToChain} from '@privy-io/react-auth';

// Configure the Flashbots RPC URL for mainnet
const mainnetWithFlashbotsProtect = addRpcUrlOverrideToChain(

Next, pass the chain configured with the Flashbots RPC URL to the config.supportedChains property of the PrivyProvider:

    supportedChains: [mainnetWithFlashbotsProtect, ...otherChains],
  {/* your app's content */}

That's it! Once you've configured Flashbots Protect as the RPC URL for your desired chain, Privy will route your users' transactions through the private Flashbots mempool.


Flashbots Protect currently only supports Ethereum mainnet, the Ethereum Sepolia testnet, and the Ethereum Holesky testnet. The team is actively building support for other networks, including L2s, as well.