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_sendBundlethe hash of the pending target, instead of the fully encoded transaction. - Your backrun: the backrun must pay the
fee_recipientthe 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.
- Request fields
- Example request
- Example response
{
"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
}
]
}
curl -X POST https://rpc.mevblocker.io/fast \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_callMany",
"params": [[{
"transactions": [{
"from": "0xDAFEA492D9c6733ae3d56b7Ed1ADB60692c98Bc5",
"to": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"gas": "0x92c0",
"gasPrice": "0x7896e72a000",
"value": "0x0",
"data": "0x70a0823100000000000000000000000047ac0fb4f2d84898e4d9e7b4dab3c24507a6d503"
}],
"blockOverride": {
"blockNumber": "0xe39dd0"
}
}], {
"blockNumber": "0x103434E",
"transactionIndex": 234
}],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": [[{
"value": "000000000000000000000000000000000000000000000000000470de54da7138"
}]]
}
Step 3: Submit the bundle
Send the backrun bundle to the wss://searchers.mevblocker.io websocket connection using the
eth_sendBundle method.
- Example request
- Example response
{
"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
}
]
}
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x164d7d41f24b7f333af3b4a70b690cf93f636227165ea2b699fbb7eed09c46c7"
}