Overview
Builder Execution Extension (BEX) is a unique Eureka Builder capability that lets protocols perform an off-chain compute against live block state and use the result to drive an on-chain transaction — all within the same block, atomically.
This solves a fundamental problem in DeFi: many on-chain actions require knowing a value (a balance, a price, a position size) that only exists at execution time. With BEX, the builder reads that value right before executing, eliminating the need for on-chain oracles or pre-committed calldata.
It also offloads gas-heavy logic to the block builder when it would be uneconomic or infeasible to run inside an Ethereum transaction.
How It Works
A BEX request targets a specific block and consists of two parts:
Request envelope
targetBlock: the block number this request targets
Compute — a staticcall the builder runs off-chain against the current mid-block state:
compute.to: the contract to call off-chaincompute.calldata: the calldata for the off-chain compute
Execute — the on-chain transaction the builder signs and submits using the compute result:
execute.to: the contract to call on-chainexecute.selector: the function to call - 4 byte function selector, hex-encoded with 0x prefixexecute.prefixArgs: fixed arguments prepended before the compute resultexecute.appendComputeResult: iftrue, the raw return data from compute is appended
Replacement fields (optional, for replaceable bundles):
replacementUuid: a stable UUID identifying a replaceable bundle slot. RequiresX-Flashbots-Signature.replacementNonce: a monotonically increasing nonce; higher nonce replaces lower nonce for the same (replacementUuid,signer)pair.
The builder assembles the final calldata as:
The resulting transaction is signed by the builder's coinbase key and included in the block.
Use Cases
Conditional liquidations — read a position's health factor, execute only if below threshold
Dynamic arbitrage — read current pool reserves, compute optimal swap amount on-chain
Oracle-free settlements — read live price data and settle a contract without a trusted oracle
Rebalancing — read current allocations and rebalance to target weights in one transaction
Default Limits
Call bex_capabilities to query the current limits for this builder:
maxCalldataBytes
24,576 bytes (24 KiB)
Maximum size of compute.calldata or execute.prefixArgs
maxComputeGas
10,000,000
Maximum gas for the off-chain compute staticcall
maxExecuteGas
500,000
Maximum gas for the on-chain execute transaction
Requests expire after 60 seconds if their target block hasn't been built.
Authentication
BEX requires the X-Flashbots-Signature header when:
An allowlist is configured (production) — your signing address must be whitelisted
Using
replacementUuid— the same signer must submit all replacements and cancellations
Contact the Eureka team to get your address added to the allowlist.
API Methods
Query builder limits (calldata size, gas caps)
{ maxCalldataBytes, maxComputeGas, maxExecuteGas }
All requests are sent as JSON-RPC 2.0 POST to:
Last updated
