Sending Bundles

A “bundle” is an ordered list of signed transactions that a searcher (or user) wants included in a block together, alongside a specific bid. Below are examples in several programming languages showing how to send a bundle to the Mev Zone system.

Note: In all examples, replace MEV_ZONE_RELAY (or a similarly named variable) with the actual endpoint for your Mev Zone relay or block builder.

import { ethers } from 'ethers';
import axios from 'axios';

async function sendBundle() {
  // Example: Two raw signed transactions
  const signedTx1 = "0xf86c..."; // replace with real signed tx
  const signedTx2 = "0xf86c..."; // replace with real signed tx

  const bundle = [signedTx1, signedTx2];
  const maxBlockNumber = 12345678; // example block number

  const requestBody = {
    jsonrpc: "2.0",
    method: "eth_sendBundle",
    params: [{
      bundle,
      maxBlockNumber,
    }],
    id: 1
  };

  try {
    const response = await axios.post(MEV_ZONE_RELAY, requestBody);
    console.log("Bundle sent, response:", response.data);
  } catch (error) {
    console.error("Error sending bundle:", error);
  }
}

sendBundle();

Last updated