Account for MEV revenue per block
A searcher's gross extractable value is not revenue: gas paid by losing legs, the builder bid, and failed attempts all come off the top, and the honest number is net of every one of them.
Procedure
Start with gross extracted value from the included legs. For a backrun, it is the token delta of the searcher address between the pre-block and post-block state:
cast balance $SEARCHER --block $((N-1)) --rpc-url $RPC
cast balance $SEARCHER --block $N --rpc-url $RPC
Read the difference in the asset you actually gained, not ETH unless you ended in ETH.
Subtract the builder payment. In a Flashbots bundle the payment is the coinbaseDiff reported by eth_callBundle, or the coinbase transfer visible in the block. This is the dominant cost on competitive opportunities.
Subtract gas. Even in a bundle, the gas burned is separate from the tip on some relay paths; on a direct eth_sendBundle the payment usually is the gas, so do not double count.
Add back failed attempts. Reverting bundles usually cost nothing on-chain (they are never included), but simulations, RPC calls, and the opportunity cost of capital tied up in an unlanded arb are real. Track them per strategy, not per block.
Reconcile with the block's own accounting: list every transaction from your address in block N and sum transfers out and in. A discrepancy means a rebate, refund, or an unaccounted internal transfer.
For recurring strategies, keep a per-block ledger: gross_extracted, builder_bid, gas_paid, net. Net divided by gross over 100 blocks is the take-rate; a take-rate under 0.4 means the bid curve is eating the edge.
Attribute by classification, not by address hygiene: label each landed bundle as arbitrage, liquidation, sandwich, or backrun so the ledger can be compared across strategy families.
Pitfalls
- Reading gross token deltas and calling it profit. On a competitive arb the builder bid typically captures 60–90% of the gross.
- Counting a bundle's gas twice because both a receipt and a coinbase transfer are visible.
- Mixing accounting currencies. Sum only after converting to a single unit at the block's price; doing it at the day's close makes per-block comparisons meaningless.
- Omitting failed attempts. A strategy with a 30% land rate shows far lower net than its winners imply.
- Ignoring inventory risk: an arb that ends holding a volatile token has unrealized loss not in any balance difference at block close.
Verification
cast balance $SEARCHER --block $((N-1)) --rpc-url $RPC && cast balance $SEARCHER --block $N --rpc-url $RPC
Then reconcile the summed line items against the observed balance delta; the residual should be zero after fees. Report gross, bid, gas, and net per block, plus the rolling take-rate.
1---2name: account-for-mev-revenue-per-block3description: Use when computing what a searcher actually earned in a block, separating gross extractable value from gas, bid, and failed-bundle costs. Covers the line items that turn a headline number into net revenue.4metadata:5 source: https://skillmd.com/skills/jiayaoqijia/account-for-mev-revenue-per-block6---78# Account for MEV revenue per block910A searcher's gross extractable value is not revenue: gas paid by losing legs, the builder bid, and failed attempts all come off the top, and the honest number is net of every one of them.1112## Procedure13141. Start with gross extracted value from the included legs. For a backrun, it is the token delta of the searcher address between the pre-block and post-block state:1516 ```bash17 cast balance $SEARCHER --block $((N-1)) --rpc-url $RPC18 cast balance $SEARCHER --block $N --rpc-url $RPC19 ```2021 Read the difference in the asset you actually gained, not ETH unless you ended in ETH.22232. Subtract the builder payment. In a Flashbots bundle the payment is the `coinbaseDiff` reported by `eth_callBundle`, or the coinbase transfer visible in the block. This is the dominant cost on competitive opportunities.24253. Subtract gas. Even in a bundle, the gas burned is separate from the tip on some relay paths; on a direct `eth_sendBundle` the payment usually *is* the gas, so do not double count.26274. Add back failed attempts. Reverting bundles usually cost nothing on-chain (they are never included), but simulations, RPC calls, and the opportunity cost of capital tied up in an unlanded arb are real. Track them per strategy, not per block.28295. Reconcile with the block's own accounting: list every transaction from your address in block N and sum transfers out and in. A discrepancy means a rebate, refund, or an unaccounted internal transfer.30316. For recurring strategies, keep a per-block ledger: `gross_extracted`, `builder_bid`, `gas_paid`, `net`. Net divided by gross over 100 blocks is the take-rate; a take-rate under 0.4 means the bid curve is eating the edge.32337. Attribute by classification, not by address hygiene: label each landed bundle as arbitrage, liquidation, sandwich, or backrun so the ledger can be compared across strategy families.3435## Pitfalls3637- Reading gross token deltas and calling it profit. On a competitive arb the builder bid typically captures 60–90% of the gross.38- Counting a bundle's gas twice because both a receipt and a coinbase transfer are visible.39- Mixing accounting currencies. Sum only after converting to a single unit at the block's price; doing it at the day's close makes per-block comparisons meaningless.40- Omitting failed attempts. A strategy with a 30% land rate shows far lower net than its winners imply.41- Ignoring inventory risk: an arb that ends holding a volatile token has unrealized loss not in any balance difference at block close.4243## Verification4445 cast balance $SEARCHER --block $((N-1)) --rpc-url $RPC && cast balance $SEARCHER --block $N --rpc-url $RPC4647Then reconcile the summed line items against the observed balance delta; the residual should be zero after fees. Report gross, bid, gas, and net per block, plus the rolling take-rate.