Skip to main content

Bid on transactions

Searchers bid on transactions by submitting bundles that include the hash of the target transaction and a backrun transaction that pays the bid amount to the fee recipient.

Step 1: Construct a backrun bundle

A bundle has 2 transactions:

  • The hash of the target transaction: make the first element of the transactions array in params of eth_sendBundle the hash of the pending target, instead of the fully encoded transaction.
  • Your backrun: the backrun must pay the fee_recipient the bid with an Ether transfer.

Step 2: (Optional) Simulate your bundle

Before submitting your bundle, you can use the eth_callMany method to simulate it against a specific block number. This helps verify that your bundle will execute correctly before you submit it.

The eth_callMany method allows you to simulate a bundle at the top of the next block, helping you:

  • Verify your bundle will execute successfully.
  • Check return values and state changes.
  • Test against different block numbers.
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_callMany",
"params": [
{
txs, // Array[String], A list of signed transactions to execute in an atomic bundle
blockNumber, // String, a hex encoded block number for which this bundle is valid on
stateBlockNumber, // String, either a hex encoded number or a block tag for which state to base this simulation on. Can use "latest"
timestamp, // (Optional) Number, the timestamp to use for this bundle simulation, in seconds since the unix epoch
}
]
}

Step 3: Submit the bundle

Send the backrun bundle to the wss://searchers.mevblocker.io websocket connection using the eth_sendBundle method.

{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_sendBundle",
"params": [
{
"txs": [
"txHash", // originator transaction
"rawTxHex" // searcher transaction
],
"blockNumber": "0x102286B", // (Optional) String, a hex-encoded block number for which this bundle is valid. Default, current block number
"replacementUuid": "blinklabsxyz", // (Optional) String, any arbitrary string that can be used to replace or cancel this bundle
}
]
}