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.

import axios from "axios";

async function sendBundle() {
  const bundle = [
    "0xf86c...2b", // replace with real signed tx
    "0xf86c...1c", // replace with real signed tx
  ];

  const requestBody = {
    jsonrpc: "2.0",
    id: "1",
    method: "eth_sendBundle",
    params: [
      {
        txs: bundle,                         // List of signed raw transactions
        maxBlockNumber: 123456789,           // Max block number for bundle validity
        minTimestamp: 123456789,             // Min Unix timestamp (seconds)
        maxTimestamp: 1234567898,            // Max Unix timestamp (seconds)
        revertingTxHashes: ["0x1234", "0x1234"], // Hashes allowed to revert
      },
    ],
  };

  try {
    const { data } = await axios.post(
      "https://builder.mev.zone/ext/bc/C/rpc",
      requestBody,
      { headers: { "Content-Type": "application/json" } }
    );
    console.log("Bundle sent, response:", data);
  } catch (err) {
    console.error("Error sending bundle:", err);
  }
}

sendBundle();

Last updated