Flashbots tutorial & Flashbots bundles guide
This Flashbots tutorial explains how to use Flashbots bundles to submit private bundles, through documented private builder routes, FRB Agent.
Linkable summary
How FRB frames Flashbots
FRB's Flashbots tutorial offers a neutral, step-by-step description of private bundles, relay selection, and gas policy so media outlets can quote one concise explanation of how Flashbots fits into responsible MEV execution.
What is Flashbots?
Flashbots is a research and development organization working on MEV infrastructure. Its documentation separates user transaction protection from searcher bundle submission to block builders.
The documented bundle path provides these capabilities:
- Ordered transaction groups for a target block
- Explicit timestamp, expiry, and revert handling
- Simulation before submission
- Optional distribution to selected builders
- On-chain verification of component transactions
Step-by-Step Guide
Step 1: Choose the Correct Product
Use Flashbots Protect for user transaction routing and the builder API for searcher bundles. The endpoints and semantics are different.
Step 2: Construct the Exact Bundle
Create and sign the ordered transactions, define the target block, and explicitly list any transaction hashes that are allowed to revert.
Step 3: Simulate Against Target State
Simulate the same ordered transactions and fee policy intended for submission. Save logs, gas use, and revert reasons.
Step 4: Set Cost and Expiry Limits
Define builder payment, fee caps, target block, expiry, and replacement policy before submission.
Step 5: Submit Through Documented APIs
Submit to the builder API and record selected builders, request identifiers, and responses. API receipt is not on-chain inclusion.
Step 6: Verify On-Chain
Confirm component transaction hashes on-chain and record included, expired, rejected, and not-included attempts separately.
Flashbots route capability map
Choose the route by audience and documented behavior. This is not a provider ranking or performance benchmark.
| Product path | Audience | Documented behavior | Measurement note | Boundary |
|---|---|---|---|---|
| Flashbots Protect | Ethereum user transactions | Private transaction routing | Verify current fallback policy | For wallet users; not the searcher bundle endpoint. |
| Flashbots Builder API | Ethereum searcher bundles | Target-block bundle submission | Measure from your own region | For ordered bundles; confirm component transactions on-chain. |
| Flashbots Multiplexing | Selected builders | API distribution to configured builders | No universal benchmark | Builder selection expands distribution but does not ensure inclusion. |
- Recheck the official API documentation before changing a production route.
- Use the same workload, region, and observation window when comparing builders.
- Record receipt, inclusion, expiry, rejection, and costs as separate states.
Where Flashbots fits in modern block building
Flashbots participates in Ethereum block-building infrastructure while exposing separate documentation for searchers, users of Flashbots Protect, and validator or builder operators.
- A searcher bundle targets a block and preserves the supplied transaction order.
- A reverting transaction invalidates a bundle unless its hash is explicitly allowed to revert.
- API receipt must be followed by on-chain confirmation.
Treat builder selection, payment, target block, permitted reverts, and expiry as explicit configuration. Record them with every result so later reviews can reproduce the submission.
Bundle Structure
A Flashbots bundle consists of:
- Transactions: Ordered signed transactions with explicit revert policy
- Block Number: Target block for inclusion
- Min Timestamp: Minimum block timestamp (optional)
- Max Timestamp: Maximum block timestamp (optional)
Example Bundle
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_sendBundle",
"params": [{
"txs": [
"0x02f8...", // Transaction 1
"0x02f8..." // Transaction 2
],
"blockNumber": "0x1234567",
"minTimestamp": null,
"maxTimestamp": null
}]
}Cost and Builder Payment Policy
Pricing and builder payment must be bounded and measured. Key considerations:
- Set a maximum total cost before submission
- Include expired and rejected attempts in the ledger
- Use the same workload when comparing builder configurations
- Use tools like our Gas Calculator to document a cost ceiling
- Re-simulate when state, target block, or fee assumptions change
Code Examples
JavaScript/TypeScript Example
import { ethers } from 'ethers';
const flashbotsRpc = 'https://rpc.flashbots.net';
const provider = new ethers.JsonRpcProvider(flashbotsRpc);
async function submitBundle(txs: string[], targetBlock: number) {
const bundle = {
jsonrpc: '2.0',
id: 1,
method: 'eth_sendBundle',
params: [{
txs: txs,
blockNumber: '0x' + targetBlock.toString(16),
}],
};
const response = await fetch(flashbotsRpc, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(bundle),
});
return await response.json();
}Python Example
import requests
import json
def submit_bundle(txs, target_block):
url = 'https://rpc.flashbots.net'
payload = {
'jsonrpc': '2.0',
'id': 1,
'method': 'eth_sendBundle',
'params': [{
'txs': txs,
'blockNumber': hex(target_block),
}],
}
response = requests.post(url, json=payload)
return response.json()Best Practices
- Start Small: Test with small amounts before scaling up
- Monitor Status: Use Flashbots dashboard to track bundle status
- Optimize Gas: Refine fee policy only from complete, timestamped samples
- Error Handling: Implement robust error handling for failed submissions
- Rate Limiting: Respect rate limits to avoid being blocked
- Simulation: Use Flashbots simulation endpoint to test bundles before submission
Flashbots vs Public Mempool
| Feature | Flashbots | Public Mempool |
|---|---|---|
| Front-running Risk | Provider-defined pre-inclusion routing | Visible to public peers before inclusion |
| Gas Costs | Builder payment plus network fees | Network fees and replacement costs |
| Complexity | Higher (requires API integration) | Lower (standard transactions) |
| Privacy | Defined by provider policy before inclusion | Pending transaction is publicly observable |
Learn more in our Flashbots vs Public Mempool comparison.
Additional Resources
- Flashbots Documentation
- Flashbots Protect - User transaction protection route
- MEV Strategies Guide - Advanced strategies
- Ethereum MEV Guide - Network-specific tips
- Gas Calculator - Optimize gas prices
Next Steps
Ready to start using Flashbots? Here's what to do next:
- Review the official Flashbots documentation
- Set up your development environment
- Test bundle submission in simulation mode
- Start with small test bundles
- Monitor and optimize your strategies
- Consider using FRB Agent for automated MEV trading
Related FRB resources
- Compare private vs public executions with the Flashbots vs public PGA guide and the Flashbots benchmark page.
- Review documented controls through the telemetry policy, security overview, and vulnerability disclosure.
- Provide next steps with the Gas Calculator, WSS latency test, and support team.
Key Takeaways
- Flashbots documents separate paths for user transaction protection and searcher bundles.
- Use the builder API for bundles and Protect for its documented user transaction purpose.
- Simulate the exact bundle and set cost, target-block, expiry, and revert policy before submission.
- Treat API receipt, on-chain inclusion, and final confirmation as separate states.
Official References
Before you bounce, tie this tutorial to the core execution steps: Download FRB, follow the install guide, and keep Support & SLA handy whenever Flashbots bundles need escalation.
Revisit the FRB pricing plans and Knowledge Base so every simulation and live run is documented before capital goes live.