Wallets and tools · How-to
How to Protect Yourself From MEV Bots With Flashbots RPC
Public mempool transactions can be sandwiched or front-run before they land on Ethereum. This guide shows how to route swaps through the Flashbots Protect RPC, what it covers, and what it cannot fix.
By the DappsAtlas editorial team · Updated

What do MEV bots actually do to your transactions?
MEV stands for maximal extractable value: profit that can be earned by choosing, inserting or reordering transactions inside a block. Much of it is harmless or even useful. Arbitrage keeps prices consistent between exchanges, and liquidations keep lending markets solvent. The part that costs ordinary users money is the predatory kind.
The most common attacks on retail traders are:
- Sandwich attacks. A bot sees your pending swap, buys the same token just before you to push the price up, lets your trade fill at the worse price, then sells right after. You receive fewer tokens, and the bot keeps the difference.
- Front-running. A bot copies your pending transaction, such as a mint or a purchase, and pays a higher gas price so it executes first.
- Back-running. A bot places a transaction right after yours to capture an opportunity your trade created. This usually does not hurt you directly, but it takes value that your trade generated.
All of these depend on one thing: your transaction being visible before it is confirmed. When you send a transaction from a wallet using its default settings, it goes to a public mempool, a waiting area that anyone running a node, and every searcher bot, can read. Bots scan it constantly and simulate your trade to see whether it can be exploited.
The size of the loss depends on trade size, pool liquidity and your slippage tolerance. Large swaps in thin pools, and trades with very loose slippage, are the easiest targets. Keeping a transaction out of the public mempool removes the visibility that these attacks rely on, which is the idea behind Flashbots Protect.
What is the Flashbots Protect RPC and how does it work?
Flashbots is a research and development organisation focused on MEV on Ethereum. One of its best-known tools for ordinary users is Flashbots Protect, a custom RPC endpoint you add to your wallet.
An RPC endpoint is the server your wallet talks to when it reads the blockchain and submits transactions. By default, a wallet like MetaMask uses a provider chosen by its developers, and your signed transaction is broadcast so that it reaches the public mempool. With Flashbots Protect, the wallet sends the signed transaction to Flashbots instead. Flashbots then passes it privately to block builders, the parties that assemble the blocks validators propose.
This changes two things:
- Your transaction is not visible in the public mempool while it waits. Bots that watch the pool cannot see it, so they cannot build a sandwich around it.
- Reverting transactions are not included on chain. Flashbots has said that Protect transactions that would fail are not mined, so you generally do not pay gas for a failed swap that bots caused by moving the price. Check the current documentation for exact behaviour.
Protect also supports MEV-Share, a system where some of the value that searchers could extract from your transaction can be returned to you as a refund, depending on the settings and hints you choose. It is optional, and the details of what is shared and how much is returned are described in the Flashbots documentation.
Flashbots Protect does not require a new wallet, a new account or a token. You change a network setting. Your keys stay in your wallet, and the RPC only receives transactions you have already signed.
What does Flashbots Protect not protect you from?
Private routing is useful, but it is not a full safety system. Knowing its limits stops you from relying on it for the wrong things.
What it helps with
- Sandwich attacks and front-running that depend on seeing your pending transaction in the public mempool.
- Paying gas for a failed transaction that was knocked off course by bots.
What it does not help with
- Bad approvals. If you approve a token contract to spend unlimited funds, or sign a malicious permit, Protect will deliver that transaction privately. It cannot judge intent.
- Scam tokens and honeypots. A token you cannot sell is still a token you cannot sell.
- Price impact and loose slippage. If you set 20 percent slippage on a thin pool, the pool itself can give you a bad price even without a bot. Private routing does not improve a poor trade.
- Phishing and fake sites. A malicious site that asks for your signature can drain your wallet, whichever RPC you use.
- Guaranteed inclusion or speed. Because only some builders may receive your transaction, inclusion can take longer than a public broadcast, especially if your fee is low.
- Other chains by default. Ordering rules differ on layer-2 networks and other chains, so check the current documentation for what is supported.
There is also a trust trade-off. Any RPC provider can see your signed transactions and IP address, and the provider could in principle choose not to forward them. Using Flashbots means trusting that organisation instead of your wallet's default provider. Many users consider that acceptable, but it is a choice, not a free lunch.
Treat Protect as one layer of defence alongside sensible slippage, careful approvals and a hardware wallet for larger balances.
What should you check before you switch RPCs?
Spend a few minutes on preparation, because a mistyped network setting is the most common cause of problems.
Checklist
- Get the details from the official source. Open the Flashbots Protect documentation by typing the site address yourself or using a bookmark you trust, then copy the RPC URL shown there. Never take an RPC address from a social media reply, direct message or search ad. A fake RPC could log your activity or block your transactions.
- Know the Ethereum mainnet values. The chain ID is 1, the currency symbol is ETH and the network is Ethereum Mainnet. A mismatch between the chain ID and the RPC will make the wallet show a warning.
- Check which settings you want. The Protect interface lets you generate a URL with options, such as speed and how much information is shared with searchers. Decide before you copy the URL. If you are unsure, start with the default.
- Keep your original network. Do not delete your default Ethereum network. Add Protect as a second entry so you can switch back if you need to.
- Have enough ETH for gas. Private transactions still need a competitive fee to be picked up by builders.
- Update your wallet. Older versions may handle custom RPC and network warnings differently.
It also helps to decide when you will use Protect. Swaps on decentralised exchanges, NFT mints, token purchases and any transaction whose outcome depends on price are the best candidates. A simple ETH transfer to your own address gains little from it, though it does no harm.
Finally, remember that custom RPCs are per network entry in most wallets. If you use several accounts, they all share that network setting, so check the active network before you sign.
How do you add Flashbots Protect to MetaMask?
MetaMask lets you add any network manually, and the process is similar in other EVM wallets. Menu names change between versions, so follow the logic if the labels differ.
Steps
- Open MetaMask and open the network selector at the top of the window.
- Choose the option to add a network, then select the manual or custom entry.
- Enter a clear Network name, for example Flashbots Protect.
- Paste the RPC URL you copied from the official Flashbots documentation.
- Enter Chain ID 1.
- Enter Currency symbol ETH.
- Optionally, add the address of a block explorer for Ethereum mainnet so you can view transactions from the wallet.
- Save, then select the new network from the list.
When you switch to it, your balances should look exactly the same as on regular Ethereum mainnet, because it is the same chain with a different door. If your balance shows zero or the wallet shows a chain ID error, stop and check the values you typed.
Using it day to day
- Before a swap or mint, confirm the active network is the Protect entry.
- Connect to the app as usual. The app does not need to know about Protect.
- Review the transaction preview and sign it.
- After signing, the wallet may show the transaction as pending for longer than usual, since it is not broadcast to the public pool.
If an app tries to switch your network, MetaMask will ask for permission. Approve only switches to networks you recognise, and check that your selection stays on the Protect entry afterwards.
How do you set it up in other wallets and with a hardware wallet?
The setup is almost the same everywhere because the Protect RPC follows the standard Ethereum interface. Any wallet that supports custom networks can use it.
Other software wallets. Wallets such as Rabby, Rainbow, Coinbase Wallet and Trust Wallet support custom networks in their settings, though the exact menus differ. Some wallets also offer built-in private transaction routing or MEV protection as a feature, in which case you may not need to add anything. Check what your wallet's documentation says, and what service it uses, before assuming it is protected.
Hardware wallets. A Ledger or Trezor signs transactions on the device, while the companion software, usually MetaMask or another interface, chooses where to send them. If you connect the hardware wallet to MetaMask and select the Protect network, the signed transaction goes to Flashbots. The device screen still shows the recipient and amount, which you should verify as normal.
Mobile wallets. The steps are the same, but typing a long URL on a phone is error-prone. Copy and paste it from the official documentation, and check the whole string after pasting.
Wallet apps with locked networks. A few wallets do not allow custom RPCs for the built-in Ethereum network. In that case you can use a different wallet that supports custom networks, or an exchange tool that offers its own private routing.
Whatever you use, test with a small transaction before a large one. Confirm that the network, chain ID and balances are what you expect, and that the transaction goes through before you trust the setup with significant funds.
What are fast mode, hints and refunds?
The Protect interface lets you tune how your transaction is handled. The options have changed over time, so read the current documentation rather than relying on a fixed description. In general, they fall into three areas.
Speed. A faster mode usually sends your transaction to more builders to improve the chance of quick inclusion. The trade-off may be the level of privacy or the refund you receive. A slower, more conservative mode may wait for particular builders to include the transaction.
Hints. When MEV-Share is used, you can choose what information about your transaction is shared with searchers so that they can compete to back-run it. Sharing less gives you more privacy but may reduce opportunities for refunds. Sharing more can allow searchers to bid for the opportunity that your transaction creates, with some of the value returned to you.
Refunds. If a searcher profits by back-running your trade, part of that profit can be paid back to your address. The share and the conditions are defined by the service, so check them rather than assuming a particular percentage. Refunds are not guaranteed, because many transactions do not create a back-running opportunity.
How to choose
- If you want the simplest setup, use the default settings.
- If you care most about privacy, minimise the hints.
- If you are trading urgently, consider faster inclusion, and accept that it may involve broader distribution.
Whichever you choose, the settings are encoded in the RPC URL you generate. If you change your preferences, you need to update the network entry in your wallet with the new URL, or add a second entry for a different profile.
How do you confirm Protect is working?
Do not assume that adding a network means it works. A short check takes a few minutes.
Step-by-step test
- Make sure your wallet shows the Protect network as active.
- Send a small, low-risk transaction, such as a tiny swap or a transfer between your own accounts.
- Look at the wallet's activity list. It should show the transaction as pending until it is included in a block.
- Open the Flashbots Protect status tool, if available, and enter your transaction hash to see whether it is pending, included or dropped.
- After confirmation, open the transaction on a block explorer. Some explorers label transactions that were not seen in the public mempool before inclusion, though the labelling varies.
What you might see
A Protect transaction typically does not appear in public pending-transaction lists before it is mined. That is expected. If you search for the hash on an explorer immediately after signing and it says not found, that does not mean it failed. The Protect status tool, or waiting for the next few blocks, is a better indicator.
Signs something is wrong
- Your wallet shows a chain ID mismatch or an unfamiliar warning.
- Your balance does not match what the explorer shows for the same address.
- The transaction is visible in the public pending pool right after you send it.
If any of these happens, switch back to your default network, remove the entry and re-add it from the official documentation. Never continue with a setup you cannot explain.
What if a Protect transaction is stuck or pending?
Private transactions behave differently from public ones, and that can be confusing the first time a transaction sits pending.
Common causes and fixes
- Gas fee too low. Builders choose the most profitable transactions. If the base fee rises after you sign, your transaction may wait. Check the current gas level on a gas tracker and, if needed, replace it with a higher fee.
- Nonce problems. Each transaction needs the next nonce for your account. If an earlier transaction is stuck, later ones queue behind it. Resolve the oldest pending one first.
- Expired or dropped transaction. Protect does not keep a transaction forever, so one that is not included within its window can be dropped. The status tool or your wallet will show whether it is still active.
- Would have reverted. Transactions that would fail, for example because the price moved beyond your slippage, may simply not be included. This protects your gas, but it means you may need to resubmit with updated settings.
Replacing or cancelling
To replace a transaction, send a new one with the same nonce and a higher fee. Wallets usually offer speed up and cancel buttons that do this. Because the original was private, behaviour can vary, so check the Flashbots documentation for how replacements are handled. If the original is stuck for a long time, switch your wallet to its default network and submit the replacement there, so it reaches the public pool.
Only switch RPCs when you have no pending transaction you care about, or you may create two transactions with the same nonce competing against each other.
What other defences should you combine with Flashbots Protect?
Flashbots Protect is one tool among several. Combining defences works better than relying on one.
| Defence | What it does | Trade-off |
|---|---|---|
| Private RPC such as Flashbots Protect | Keeps transactions out of the public mempool | You trust the RPC operator; inclusion can be slower |
| Tight slippage tolerance | Limits how much a bad fill can cost | Trades may fail in volatile markets |
| Limit orders or intent-based swaps | Fill only at your price, often with solvers competing | Slower, and not available for every token |
| Smaller trades or split trades | Reduces the profit available to attackers | More gas fees, more steps |
| MEV-aware aggregators and RPCs from other providers | Offer similar private routing or auctions | Different rules and trust models |
Habits that matter
- Check price impact on the swap screen before you sign.
- Avoid unlimited token approvals, and revoke ones you no longer need.
- Be wary of tokens with very thin liquidity, since they are easier to manipulate.
- Use a separate wallet for experimental apps.
Privacy tools are different. Protocols such as Railgun focus on shielding who owns what and who pays whom, not on blocking sandwiches. They solve a different problem, and some jurisdictions treat privacy tools with caution, so check local rules before using them.
On other chains. Layer-2 networks such as Arbitrum, Optimism and Base typically order transactions through a sequencer rather than an open public mempool, so the attack surface differs. When you move funds with a bridge such as Across or a canonical bridge, the main risks are the bridge contracts and approvals, not mempool sandwiching. Check each network's documentation for its current ordering and protection model.
Frequently asked questions
Does Flashbots Protect cost anything?
Flashbots Protect is free to add as a network RPC, and you pay only the normal network gas fee. Some setups may share a share of MEV refunds back with you, but whether that applies depends on your settings and the current docs, so check them before relying on it.
Does Flashbots Protect make my swaps completely safe?
No. It reduces exposure to public-mempool attacks such as sandwiching and front-running by keeping your transaction out of the public pool. It does not fix a bad approval, a scam token, high price impact or a loose slippage setting, so you still need to review each transaction.
Can I use it with a hardware wallet?
Generally yes. Protect is an RPC endpoint, so your hardware wallet signs as usual and the wallet app sends the signed transaction to a different place. Check the transaction details on the device screen as you normally would.
Why is my transaction pending after I used Protect?
The usual causes are low gas, a gap in nonces, or a transaction that would have reverted and so was never included. Check the transaction status in the Protect tool or on a block explorer. If it stays pending, switch your wallet back to its default RPC and replace the transaction with the same nonce and a higher fee.
Does it work on layer-2 networks like Arbitrum or Base?
Not automatically. The Protect RPC was built for Ethereum mainnet, and other chains have different transaction ordering, often controlled by a single sequencer. Check the current Flashbots documentation for supported networks, and use the protections that the specific chain or app provides.
Is a custom RPC a privacy or security risk?
The RPC provider can see your signed transactions and your IP address, as with any RPC provider. Use only the official endpoint from the Flashbots documentation, because a fake RPC address could be used to censor or log your activity.
Mentioned in this guide
dApps in this guide
Railgun is a zk-SNARK privacy protocol for Ethereum, Arbitrum, BNB Chain and Polygon that shields DeFi transactions, for users wanting on-chain privacy.
Across is an intent-based cross-chain bridge and swap protocol for moving tokens between Ethereum, rollups and other chains, with an API for apps.
Arbitrum Bridge is the canonical bridge that moves ETH and ERC-20 tokens between Ethereum mainnet and the Arbitrum Layer-2 rollup.
Base Bridge is the canonical bridge for moving supported assets and data between Ethereum and Coinbase's Base layer-2 chain, with about $3B in TVL.
Optimism Bridge is the canonical bridge between Ethereum and OP Mainnet, used to move assets to the Optimism layer 2.
Sherlock is a Web3 security firm offering audits, contests, AI review and bug bounties for onchain teams, formerly known for DeFi coverage.
Common is a non-custodial ZK privacy dapp on Arbitrum and Aleph Zero EVM that lets users shield funds and withdraw to a new, unlinkable wallet.
Save, formerly Solend, is a Solana lending and borrowing protocol where users earn interest on deposits or borrow against collateral.
Keep reading
Related guides
Wallets and tools · Best list
Best Hardware and Software Crypto Wallets in 2026
A practical guide to the hardware and software crypto wallets worth considering in 2026, what each is best at, and how to set one up and secure it without leaning on hype.
Wallets and tools · Explainer
Freename Free Domain Claim: How Integrations Work in 2026
Freename lets wallets, apps and communities hand out blockchain domains, and some of those offers are free to claim. This guide explains how the claim works, what 'free' usually covers, and how to avoid fake claim pages.
Wallets and tools · Explainer
Opera's Web3 Crypto Wallet Beta Explained: Features and Risks
Opera put a crypto wallet and Web3 dApp access directly into its browser. This guide covers what a browser-native wallet is, how beta software changes the risk, and how to check and use it safely.
Wallets and tools · Best list
Best Ethereum Wallet in 2026: Software, Hardware and Layer-2 Options
Most searches for the best Ethereum wallet are really asking which option is safe and easy to use today. This guide compares the main wallet types and names, then explains how to choose and set one up without exposing your recovery phrase.
Wallets and tools · Explainer
Quicknode Explained: High-Performance Web3 Infrastructure
Quicknode is a hosted blockchain infrastructure provider that gives apps, wallets and trading teams RPC access and data tools across dozens of chains. This guide explains what it does, how it works and when it is the right fit.
Wallets and tools · Explainer
Polygon and the Nothing Phone: What the Web3 Phone Deal Meant
In July 2022, Polygon announced a collaboration with Nothing, the maker of the Nothing Phone (1), to bring Web3 features such as NFT support to mainstream phone users. This guide explains what that tie-up was, how it compares with other Web3 phones, and how to check whether its features still work today.
Wallets and tools · Explainer
Radix Wallet and the Babylon Mainnet: A Developer Guide for 2026
The Babylon mainnet was the point where Radix moved from testing into live use, and Radix Wallet is the main way people hold assets and interact with apps on the network. This guide explains what the launch was, how the wallet works, and how to use it safely in 2026.
Wallets and tools · Explainer
Polygon ID Explained: How Zero-Knowledge Identity Works
Polygon ID was a zero-knowledge identity toolkit that let people prove facts about themselves without handing over the underlying data. This guide explains how the model works, what it can and cannot protect, and how to check the project's current status.