Start typing to search this publication.
crypto.news logo crypto.news
Open menu
crypto.news logo

Subscribe to crypto.news

Get new posts delivered straight to your inbox.

How does Flashbots prevent front-running of pending swaps?

crypto.news avatar crypto.news
5 min read

Flashbots Protect keeps your signed transaction out of the public mempool by routing it privately to builders that agree not to front-run or sandwich it. That prevents the usual public-mempool attack because a bot needs to see your pending swap before it can trade ahead of you; the Flashbots research effort provides context for this private route.

How does a protected swap avoid a public-mempool front-run?

Protect removes the public preview of a swap. Say you submit a large Uniswap swap through the Protect RPC. Your wallet signs the transaction, but the signed transaction travels through the private route to builders instead of being broadcast to the public mempool. A bot watching that mempool has no pending swap to copy or trade around.

With a public broadcast, the bot could buy before your swap raises the price, let your swap execute, then sell afterward. That sequence is a sandwich: the bot’s trades surround yours, and you receive a worse execution price. Private routing removes the window in which a public-mempool bot can plan those trades from your pending transaction.

The researchers behind Flash Boys 2.0 documented bots anticipating decentralized exchange trades and competing to get their own transactions ordered first. Their finding explains the risk when trade intentions are visible before inclusion. Protect changes that visibility, though the builders receiving a private transaction still have to be trusted to handle it as agreed.

At this point, flashbots.app lets readers explore the organization’s MEV research and transaction privacy work to understand why that routing matters.

Who sees a protected transaction before it reaches a block?

Protect shares a transaction with the parties needed to seek inclusion, while MEV-Share can disclose selected hints to searchers. Those roles matter because keeping a swap out of the public mempool does not mean every participant in the private path sees the same information.

  • Protect RPC: Receives the signed transaction from your wallet and keeps it off the public broadcast path. The transaction remains private while Protect seeks a block for it.

  • MEV-Share: Shares selected hints about a transaction, such as limited information that a swap occurred, according to its privacy settings. Searchers use those hints to propose backruns—trades placed after yours. When an eligible backrun creates value, part of that value can be refunded to you.

  • Builder: Receives the private transaction and assembles a candidate block. Sending to more eligible builders can improve the chance that one of them builds the block selected for the slot, but each builder that receives the transaction becomes a party you trust with it.

  • Flashbots Relay: A relay carries a builder’s block bid toward a proposer using MEV-Boost. The proposer can select a winning builder block; your swap reaches the chain only if it is in the block that is proposed.

In the illustrative Uniswap case, the swap’s signed contents stay the same from submission to inclusion. What changes at inclusion is visibility: the transaction and its result become public on-chain. If a backrun earns a refund, that is an additional outcome of the private path, not the reason the swap was shielded from a public-mempool front-run.

MEV-Share’s hint sharing has a narrower purpose than revealing a pending transaction for arbitrary ordering. Searchers currently submit backruns through that system. A backrun follows the user’s transaction, so it cannot use that route to place the searcher’s trade ahead of the swap. A refund also depends on an eligible backrun actually producing value.

Why is my protected transaction pending or failed?

A protected transaction can remain pending because private submission and block inclusion are separate events. A builder must receive it, build a viable block containing it, and have that block selected through the MEV-Boost relay path. Protect can also withhold a transaction that would revert. A missing public-mempool entry by itself tells you little: privacy is why the entry is missing.

Use your transaction hash at protect.flashbots.net/tx/ followed by that hash to check its state. Pending means the private attempt is still in progress; included means it reached a block. A failed Protect attempt means that private submission did not get included. If you also sent a copy elsewhere, inspect the on-chain transaction or account nonce before signing anything new, because that other copy may have landed.

The easy mistake is to resend the same signed transaction through a public RPC while waiting. Its hash, sender, nonce, swap instructions and slippage limit stay the same, but its visibility changes: the public copy can spread through mempools and be sandwiched. Once that copy is public, a private copy cannot make it secret again. Some wallets may also rebroadcast when you switch RPCs before confirmation, as the Protect quick start warns.

If the private attempt has failed and you still want the swap, review its quote, slippage and fee settings, then submit the valid transaction through Protect only. That gives the next attempt the private route again. If the original is still pending, first determine whether you want to keep waiting or replace it; a second send of identical signed bytes does not improve its terms.

Does Flashbots Protect stop all MEV?

Protect addresses front-running that relies on seeing your transaction in the public mempool. MEV also includes activity after a trade, such as arbitrage caused by its price change. MEV-Share can let a searcher backrun that opportunity and return part of the resulting value to you. Market movement, your chosen slippage limit and whether a builder’s block wins still affect the outcome of your swap.

Is Flashbots Protect free to use?

Protect does not charge a separate service fee for sending a transaction, but an included Ethereum transaction still pays the gas required for execution. A transaction withheld because it would revert does not incur an on-chain gas charge from that failed attempt. A possible MEV refund depends on the transaction creating an eligible opportunity; it should not be treated as a fixed discount on gas.

Do builders other than Flashbots see my transaction?

Other builders may receive a protected transaction when its routing settings share it with them. That can increase the chance of inclusion because more builders can try to place it in a winning block. It also extends trust to each receiving builder. Searchers receiving MEV-Share hints see selected information, which is different from receiving the full signed transaction as a builder.

For a pending swap, look up its hash through Protect first. The status tells you whether to keep waiting, verify an inclusion, or prepare a new private submission without exposing the swap through a public RPC.

Subscribe to crypto.news