Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
LABS
Guides

How to Integrate MEV Supply Chains

A step-by-step technical guide for developers to connect applications to MEV supply chain components, including searchers, builders, and relays.
Chainscore © 2026
introduction
DEVELOPER GUIDE

How to Integrate MEV Supply Chains

A technical guide for developers to connect applications to the MEV supply chain, enabling access to block space and revenue opportunities.

The MEV (Maximal Extractable Value) supply chain is the network of specialized actors—searchers, builders, and relays—that compete to produce the most valuable blocks. Integrating with this supply chain allows your protocol to access this sophisticated infrastructure. For developers, this means your application's transactions can be bundled with others for efficiency, protected from front-running, or strategically positioned to capture value. The core integration points are the block builder and the relay, which serve as the gateway between users and validators.

To begin integration, you must first decide on your objective. Common use cases include: submitting transaction bundles for atomic execution, using Flashbots Protect RPC to shield user transactions, or implementing a backrunning service for your protocol's events. Each path requires interacting with different components. For bundle submission, you'll work directly with a builder or relay API. For user protection, you integrate a modified RPC endpoint. Your choice dictates the technical stack and the parties you need to trust in the supply chain.

The primary method for direct integration is via the Flashbots Relay, a neutral gateway used by many builders. You can submit bundles using its public REST API. A bundle is a JSON array of signed transactions with a specific structure, including a maxBlockNumber to denote expiry. Here is a minimal example of bundle submission using curl:

bash
curl -X POST https://relay.flashbots.net \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_sendBundle","params":[{...}],"id":1}'

Your bundle will compete in a builder auction; you can optionally specify a minTimestamp or revertingTxHashes.

For applications like DEX aggregators or lending protocols, backrunning is a key integration. When a user performs a swap or liquidation, a searcher can submit a bundle that includes the user's transaction followed by their own arbitrage or liquidation follow-up. To enable this, your protocol should emit clear event logs. Searchers monitor these logs via mempool or subgraph data. While you don't directly submit these bundles, you can foster a healthy ecosystem by ensuring your contract events are indexed and easily parseable, attracting searcher activity that improves liquidity and efficiency.

Security and risk considerations are paramount. Integrating with the MEV supply chain introduces new trust assumptions: you must trust the relay and builder not to censor or steal your transactions. Use reputable, neutral relays and consider code audits for any custom bundling logic. Be aware of bundle simulation failures; always simulate your bundle via the relay's eth_callBundle method before submission to avoid wasting gas. Furthermore, understand that bundle inclusion is not guaranteed—it depends on winning the builder's auction, so fee estimation is a complex, competitive process.

Finally, monitor and optimize your integration. Use the relay's status endpoints and explorer tools like Flashbots Explorer to track bundle acceptance and performance. Analyze metrics like inclusion rate and effective gas price paid. As the MEV landscape evolves with PBS (Proposer-Builder Separation) and new relay standards, stay updated with changes from major providers. Successful integration turns MEV from an abstract threat into a tangible lever for improving your protocol's user experience, security, and economic design.

prerequisites
DEVELOPER GUIDE

Prerequisites for MEV Integration

A technical overview of the core infrastructure and knowledge required to build or interact with MEV supply chains.

Integrating with the MEV supply chain requires a foundational understanding of its architecture. At its core, MEV extraction relies on the ability to observe pending transactions in the public mempool, construct more profitable transaction bundles, and have them included in a block. This process is facilitated by a specialized ecosystem of searchers, builders, and relays. Searchers run algorithms to identify opportunities, builders compete to construct the most valuable blocks, and relays act as trusted intermediaries that validate and forward these blocks to validators. Your integration point—whether you are a searcher submitting bundles, a protocol mitigating negative MEV, or an application leveraging positive MEV—depends on which layer of this stack you interact with.

A secure and configurable Ethereum execution client is the first practical prerequisite. You will need to run a node that provides low-latency access to transaction data. Geth and Nethermind are the most common choices. Critical configuration includes enabling the transaction pool API (--txpool.locals for priority, --txpool.globalslots to increase capacity) and potentially connecting to a flashbots-protected RPC endpoint to access the private transaction pool and avoid frontrunning. For builders and advanced searchers, running a mev-boost-compatible relay and builder is necessary to participate in the proposer-builder separation (PBS) market. This requires managing signing keys, understanding block simulation, and connecting to the mev-boost network.

Development requires specific libraries and APIs. For bundle construction and submission, the Flashbots SDK (@flashbots/sdk) provides essential utilities for signing and sending bundles to relays. For broader MEV data analysis, the Etherscan and Blockscout APIs offer transaction history, while specialized services like EigenPhi and Etherscan's MEV Dashboard provide aggregated MEV metrics. Smart contract developers must understand common MEV vectors like sandwich attacks, liquidations, and arbitrage to write resilient code. Using block.timestamp or block.number carelessly, or having large, predictable slippage tolerances in DEX swaps, can create exploitable conditions.

A robust local testing environment is non-negotiable. Use a development framework like Hardhat or Foundry to simulate MEV scenarios. Foundry's forge and cast are particularly powerful for crafting and broadcasting custom transactions. You should simulate attacks on your own contracts using forked mainnet state (e.g., fork-url in Foundry) to test resilience. For testing bundle submission without spending real ETH, use the Flashbots Goerli testnet relay or a local mev-boost and mev-geth setup. This allows you to practice the entire flow—from identifying an opportunity in a forked environment to constructing a valid bundle and observing its simulated outcome.

Finally, operational security and ethical considerations are paramount. Handling private keys for bundle signing demands secure, offline storage solutions. Understanding the legal and regulatory landscape surrounding automated market activity in your jurisdiction is crucial. Furthermore, the MEV ecosystem has norms; submitting spam bundles or exploiting clear protocol bugs can result in being censored by relays. Engage with the community through forums like the Flashbots Discord and EthResearch to stay updated on best practices and the evolving standards like SUAVE, which aims to decentralize the MEV supply chain further.

key-concepts-text
TUTORIAL

Key MEV Supply Chain Components

A technical breakdown of the core infrastructure required to build and integrate with MEV supply chains, from searchers to block builders.

The MEV supply chain is a specialized ecosystem that separates the roles of transaction discovery, bundling, and block production. At its foundation are searchers, who run complex algorithms to identify profitable on-chain opportunities like arbitrage or liquidations. They express these opportunities as transaction bundles using formats like the MEV-Share schema or by sending them directly to a block builder. This separation of concerns is a direct result of Ethereum's transition to Proposer-Builder Separation (PBS), which formalized these roles to enhance network efficiency and decentralization.

The central orchestrator is the block builder. Builders like Flashbots SUAVE, Titan, and rsync compete in a marketplace to construct the most valuable block possible. They receive bundles from searchers and public transactions from the mempool, then use optimization algorithms to order them for maximum extractable value (MEV) and fee revenue. Builders output a complete, executable block payload. To integrate, developers typically interact with a builder's JSON-RPC endpoint, submitting bundles with specific parameters like max_block_number and min_timestamp.

Communication between searchers and builders relies on standardized APIs and relay networks. The dominant standard is the MEV-Boost relay interface, which allows validators (proposers) to outsource block building. Builders send their signed block headers to relays, which attest to the block's validity and contents before forwarding the most profitable header to proposers. For integration, a searcher's bundle must be properly signed and include a refund to the fee recipient. Failure to comply with the builder's or relay's specifications will result in the bundle being rejected.

Here is a conceptual code snippet for submitting a simple arbitrage bundle to a builder using a pseudo-API. Note that real implementations require signing and precise gas estimation.

javascript
const bundleParams = {
  version: "v0.1",
  inclusion: { block: targetBlockNumber },
  body: [
    {
      tx: signedBackrunTx,
      canRevert: false
    }
  ],
  validity: {
    refund: [{ beneficiary: validatorAddress }]
  }
};

// Send to builder endpoint
const response = await fetch(BUILDER_RPC_URL, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'eth_sendBundle',
    params: [bundleParams]
  })
});

Successful integration requires understanding the economic and security constraints. Builders prioritize bundles with higher total value, which includes direct fees and the MEV captured. Searchers must ensure their bundles are simulation-safe—they should not revert when executed in the context of other transactions, or they risk being dropped. Tools like Flashbots' mev-sim and Tenderly are used for local simulation. Furthermore, integrating with multiple builders through a service like Flashbots Protect RPC can increase bundle inclusion rates and provide protection against frontrunning.

The final component is the block proposer (validator), who selects the most profitable block header presented by relays via MEV-Boost. As an integrator, your goal is to ensure your bundles make it into the builder's winning payload. Monitoring is crucial: use dashboards from relay operators or services like EigenPhi to track bundle inclusion rates and profitability. The supply chain is evolving rapidly, with new initiatives like SUAVE aiming to decentralize the building process itself, which will introduce new integration patterns and APIs for future-proof application development.

integration-paths
MEV SUPPLY CHAINS

Integration Paths for Developers

Practical guides and tools for developers to integrate with, analyze, or mitigate MEV supply chain components.

step-by-step-rpc-integration
TUTORIAL

Step 1: Integrate with a MEV-Boost RPC Endpoint

Connecting your validator to a MEV-Boost relay is the foundational step for accessing outsourced block building and earning MEV rewards.

MEV-Boost is a middleware service that allows Ethereum proof-of-stake validators to outsource block building to a competitive network of specialized builders. Instead of constructing blocks locally, your validator client connects to a MEV-Boost relay via an RPC endpoint. The relay acts as a trusted intermediary, receiving execution payloads (pre-built blocks containing MEV transactions) from builders and forwarding the most profitable one to your validator for proposal. This separation of duties is critical for maintaining decentralization and security within the MEV supply chain.

Integration requires modifying your validator client's configuration. For clients like Lighthouse or Teku, you add the --builder and --builder-relay flags. For Prysm, you use the --http-mev-relay flag. The core step is specifying the RPC endpoint URL of your chosen relay(s). You can connect to multiple relays for redundancy and to access a broader market of builders. A standard configuration in a Lighthouse beacon node command might look like: --builder http://localhost:18550 --builder-relay https://0xac6e77dfe25ecd6110b8e780608cce0dab71fdd5ebea22a16c0205200f2f8e2e3ad3b71d3499c54ad14d6c21b41a37ae@boost-relay.flashbots.net.

The endpoint URL structure is specific. It typically includes the relay's public key for authentication and the network address. After configuration, your validator will begin receiving signed blinded beacon blocks from the relay. These are block proposals where the transaction details are hidden (blinded) to prevent you from stealing the MEV. You simply sign the block header and return it, trusting the relay to provide the corresponding full transaction data to the network. Your validator's role shifts from builder to proposer, focusing on consensus duties while earning a share of the MEV extracted by professional builders.

step-by-step-builder-api
INTEGRATION

Submit Bundles via Builder API

Learn how to construct and submit transaction bundles to a block builder's API to participate in the MEV supply chain.

The Builder API is the primary interface for searchers to submit their transaction bundles to block builders. A bundle is a set of transactions that must be executed in a specific order, atomically, within a target block. The API is typically a JSON-RPC endpoint that accepts a mev_sendBundle request. The request body includes the bundle's transactions, the target block number, and a validity window. Builders like Flashbots, bloXroute, and Eden Network provide their own implementations of this API, each with slightly different parameters and requirements.

Constructing a valid bundle requires careful attention to detail. The core payload includes the txs array, containing the signed raw transaction bytes for each transaction in your bundle. You must specify the blockNumber as a hex string, indicating the block where you want the bundle included. The minTimestamp and maxTimestamp fields define the validity window in seconds, ensuring your bundle is only considered for blocks within that time range. For bundles that depend on the state of a specific block, you can use the revertingTxHashes field to specify which transactions are allowed to revert without invalidating the entire bundle.

A critical component of your submission is the privacy. To prevent front-running and sandwich attacks, you should use a private transaction relay or the builder's own privacy layer. When submitting to Flashbots, for instance, you send your bundle directly to their relay (relay.flashbots.net) instead of the public mempool. This ensures only the builder sees your transaction flow. Always include a replacementUuid if you are updating a previously submitted bundle, and consider setting an inclusion object with max_block to specify a deadline for your bundle's inclusion.

Here is a basic example of a mev_sendBundle request body for a simple arbitrage bundle targeting block number 20,000,000:

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "mev_sendBundle",
  "params": [
    {
      "txs": ["0x02f874...", "0x02f875..."],
      "blockNumber": "0x1312D00",
      "minTimestamp": 1700000000,
      "maxTimestamp": 1700000600
    }
  ]
}

The txs array contains two signed, raw EIP-1559 transactions. The timestamps give the bundle a 10-minute validity window.

After submission, you must monitor the response and subsequent blocks. A successful submission returns a bundleHash. However, inclusion is not guaranteed. You should query the builder's status API (e.g., mev_getBundleStats) with the bundleHash to check if your bundle was included in a block, reverted, or is still pending. Understanding the common failure modes—such as expired validity windows, insufficient priority fee (maxPriorityFeePerGas), or transaction revert—is essential for debugging and improving your submission strategy.

PROTOCOL OVERVIEW

Comparison of Major MEV Relays

Key operational and economic differences between leading MEV relay services for builders and proposers.

Feature / MetricFlashbotsbloXrouteEden NetworkTitan Builder

Primary Network

Ethereum Mainnet

Ethereum, Polygon, BSC

Ethereum Mainnet

Ethereum Mainnet

Open Source

Relay Fee Model

0% (Free)

0.25 ETH per month + 10% of MEV

0% (Free)

0% (Free)

Block Builder Integration

mev-boost

mev-boost, Private RPC

mev-boost

mev-boost

Proposer Payment

Block Reward + MEV

Block Reward + MEV

Block Reward + MEV + Eden Tip

Block Reward + MEV

Censorship Resistance

Complies with OFAC

Complies with OFAC

Neutral

Neutral

Avg. Inclusion Latency

< 1 second

< 500 ms

< 1 second

< 1 second

Requires Registration

step-by-step-searcher-bot
HANDS-ON TUTORIAL

Step 3: Build a Basic Searcher Bot

This guide walks you through building a foundational searcher bot that identifies and submits profitable MEV opportunities.

A searcher bot is an autonomous agent that scans the mempool, simulates transactions, and constructs bundles for submission to a block builder. Your bot's core loop consists of three phases: mempool listening, opportunity identification, and bundle construction. For listening, you can use WebSocket connections to node providers like Alchemy or QuickNode to receive pending transactions in real-time. You'll need to filter these transactions for specific patterns, such as large DEX swaps on Uniswap V3 or pending liquidations on Aave.

Once you've identified a candidate transaction, you must simulate your proposed bundle to ensure profitability and success. Use the eth_call RPC method or specialized tools like Tenderly's simulation API to test your bundle's execution and calculate potential profit, accounting for gas costs. A basic profitable opportunity could be a backrunning strategy, where your bot submits a swap immediately after a large DEX trade to capture price movement. Your simulation must verify that your transaction's gas price is high enough to be included in the same block as the target.

For bundle construction and submission, you will use the eth_sendBundle RPC endpoint exposed by a relay, such as the Flashbots Protect RPC or a private relay from builders like bloXroute. Your request must include the signed transactions in order, the target block number, and optionally a minimum/maximum timestamp. A critical security practice is to sign your bundle's transactions with a private key that holds no funds, as builders may execute your bundle in a different context than simulated. Always use a dedicated searcher wallet.

Here is a simplified code snippet in Node.js demonstrating the core flow using the Ethers.js library and the Flashbots RPC:

javascript
import { ethers } from 'ethers';
import { FlashbotsBundleProvider } from '@flashbots/ethers-provider-bundle';

// 1. Set up providers
const provider = new ethers.JsonRpcProvider('YOUR_RPC_URL');
const authSigner = new ethers.Wallet('SEARCHER_PRIVATE_KEY', provider);
const flashbotsProvider = await FlashbotsBundleProvider.create(provider, authSigner);

// 2. Listen for mempool tx
provider.on('pending', async (txHash) => {
  const tx = await provider.getTransaction(txHash);
  // Add your opportunity logic here
});

// 3. Build and submit a bundle
const signedTransactions = [signedBackrunTx]; // Array of signed tx
const bundleSubmission = await flashbotsProvider.sendBundle(
  signedTransactions,
  targetBlockNumber
);

After submission, you must monitor the target block to see if your bundle was included. Check the block's transactions against your bundle hashes. If your bundle fails or is dropped, analyze the reason: was the simulation inaccurate, was the gas bid too low, or was there a competing searcher? Implement logging for every stage—mempool event, simulation result, submission, and inclusion—to refine your strategy. Start by targeting less competitive opportunities on Ethereum testnets like Goerli or Sepolia before deploying on mainnet.

Remember, this is a basic framework. Advanced searchers implement complex strategy logic (like DEX arbitrage across multiple pools), sophisticated simulation with custom EVM tracers, and direct builder relationships to reduce latency and costs. Your bot's profitability depends on the speed of your mempool feed, the accuracy of your simulation, and the reliability of your relay connection. Always comply with the terms of service of your infrastructure providers and the relay you use.

tools-and-libraries
MEV SUPPLY CHAIN INTEGRATION

Essential Tools and Libraries

A curated selection of core libraries, frameworks, and infrastructure needed to build, analyze, or participate in the MEV supply chain.

DEVELOPER GUIDE

MEV Integration FAQ

Common questions and solutions for developers integrating with MEV supply chains, searchers, and builders.

Searchers and builders are distinct roles in the MEV supply chain. A searcher is an entity (often a bot) that identifies profitable transaction opportunities (arbitrage, liquidations) and creates transaction bundles. They use private RPCs like Flashbots Protect to submit these bundles to avoid frontrunning.

A builder is a specialized block proposer that constructs the actual block. Builders receive bundles from searchers and public mempool transactions, then use complex algorithms (like PBS - Proposer-Builder Separation) to create the most profitable block possible. The builder's block is then proposed to a validator for inclusion. Key builders include Flashbots SUAVE, Titan Builder, and rsync.

conclusion
IMPLEMENTATION GUIDE

Conclusion and Next Steps

Integrating MEV supply chains requires a deliberate strategy focused on security, modularity, and ecosystem alignment. This guide outlines the final considerations and pathways for builders.

Successfully integrating MEV-aware infrastructure begins with a clear architectural choice. You must decide whether to outsource MEV management to a specialized service like a Block Builder API (e.g., Flashbots Protect, bloXroute) or to build in-house by directly interacting with a searcher network or relay. The outsourcing path offers simplicity and robust security by default, making it ideal for most applications. The in-house path provides maximum control and customization for protocols with unique transaction ordering requirements, such as advanced DEXs or lending platforms, but demands significant expertise in transaction simulation and mempool monitoring.

For developers opting for direct integration, the next step is selecting a relay. The relay is the critical trust layer between your application and the block builders. Evaluate relays based on censorship resistance (do they filter certain transactions?), uptime and latency, supported builder network, and cost structure. Leading options include the Flashbots Relay, which is committed to credible neutrality, and Ulbricht from the EigenLayer ecosystem, which introduces decentralized verification. Your choice will dictate the final user experience and the economic security of your transactions.

The final implementation phase involves writing the integration logic. This typically means modifying your application's transaction submission flow. Instead of sending a transaction directly to a public mempool, you bundle it with specific parameters and send it to your chosen relay's endpoint. Here is a conceptual Node.js example using the Flashbots Protect RPC:

javascript
const { ethers } = require('ethers');

// Initialize provider with Flashbots RPC
const provider = new ethers.providers.JsonRpcProvider('https://rpc.flashbots.net');

async function sendProtectedTx(wallet, tx) {
  // The key step: target the 'flashbots' endpoint
  const flashbotsProvider = new ethers.providers.JsonRpcProvider(
    'https://relay.flashbots.net',
    'flashbots'
  );
  // Send the transaction via the relay
  const txResponse = await flashbotsProvider.sendTransaction(
    tx
  );
  return txResponse;
}

This ensures your transaction is considered for inclusion in a block built by a professional searcher, protecting it from frontrunning.

Beyond the initial setup, ongoing participation in the MEV ecosystem is crucial. Monitor your integration's performance using dashboards from services like EigenPhi or Etherscan's MEV tracker to analyze extracted value and sandwich attack susceptibility. Stay informed about protocol upgrades like PBS (Proposer-Builder Separation) and EIP-4844 (blob transactions), which will fundamentally reshape MEV supply chains. Engage with the research community through forums like the Flashbots Forum and EthResearch to contribute to and learn from discussions on MEV democratization and minimal viable censorship resistance.

Your journey doesn't end at integration. Consider the broader impact of your design choices. Are you creating a fairer system or potentially introducing new extractive patterns? The most sustainable integrations are those that align economic incentives for users, builders, and the network. Start with a focused testnet deployment, iterate based on data, and gradually move to mainnet. By thoughtfully integrating MEV supply chains, you don't just protect your users—you help steer the future of Ethereum's transaction ecosystem toward greater efficiency and equity.