Skip to main content

Quantifying Realized Extractable Value

Β· 11 min read
Leave a reply

Maximal (formerly Miner) Extractable Value (MEV\textrm{MEV}) is the value that can be extracted from a blockchain by any agent without special permissions. Considering this permissionless nature, any agent with transaction ordering rights will be in a privileged position to perform the extraction. In Proof of Work blockchains, it is miners who determine transaction ordering within a block, hence the former "miner" term. In practice, bot operators seek to extract MEV\textrm{MEV} by either paying high fees to increase the likelihood that their transactions are mined, or by fine-tuning their gas price choices in order to "time" their transactions right, as is the case when backrunning an oracle update to perform a liquidation.

Despite much recent discussion about the topic and, in particular, its associated risks for the Ethereum protocol, we still lack a cohesive formal model for quantifying MEV\textrm{MEV} extraction. At Flashbots, we have released an MEV\textrm{MEV} explorer where we shed light on various aspects of this phenomenon. While we do elaborate on our metrics in the site, they still lack a formal definition. Here, we attempt to provide a unifying operational framework that consolidates MEV\textrm{MEV} extraction metrics, focusing on the Ethereum network1.

General Considerations#

The first important point to make is that MEV\textrm{MEV} is a theoretical quantity that we can only approach asymptotically. Unforseen extraction methods can and will be devised (every new DeFi hack is an MEV\textrm{MEV} extraction event). Hence, we will here focus instead on the Realized Extractable Value, notated REV\textrm{REV}, where REV≀MEV\textrm{REV} \leq \textrm{MEV}. In other words, REV\textrm{REV} is the actual value extracted from the blockchain from MEV\textrm{MEV} opportunities2.

We note that there's two classes of actors in the system, searchers and miners. We use the generic label miner for actors that bear the privileged role of transaction inclusion and ordering. Searchers are any non-privileged actors aiming to profit from these opportunities. Crucially, miners can also act as searchers.

Extracting MEV\textrm{MEV} incurs externalities, like increasing gas costs for all users of the network, or bloating the chain. We won't dwell into the implications of these externalities here, but we will make them manifest in the model. For more on this and the "MEV\textrm{MEV} Crisis", be sure to check our Flashbots introductory post.

We are now ready to begin building our framework, starting with a simple model that ignores direct miner payments and searcher competition and other externalities like opportunity checks. We will revisit the model to account for these at a later stage.

Extraction Model#

We begin with a model where a single searcher performs an MEV\textrm{MEV} extraction, sharing proceeds with the block miner via gas fees only. We further assume that miners order transactions by descending gas price, which approximates well their optimal strategy and is the default in Ethereum node software.

We decompose the opportunity's REV\textrm{REV} in two terms:

REV=REVS+REVM,(1)\textrm{REV} = \textrm{REV}_S + \textrm{REV}_M, \tag{1}

where REVS\textrm{REV}_S is the value that goes to the searcher, and REVM\textrm{REV}_M is the value that goes to the miner. Note that, as we expand on below, REV\textrm{REV} already encompasses the opportunity's extraction costs (i.e. the actual REV\textrm{REV} of an opportunity depends on the gas price of the network at extraction time3).

Let's dive into the two different terms. The searcher REV\textrm{REV} is composed by:

REVS=Vinβˆ’Voutβˆ’gMEV.sMEV,(2)\textrm{REV}_S = V_{in} - V_{out} - g_{\textrm{MEV}}.s_{\textrm{MEV}}, \tag{2}

where VoutV_{out} is the value that flows from the searcher to the blockchain in the transactions performing the extraction (excluding gas); VinV_{in} is the value flowing from the blockchain to the searcher; gMEVg_{\textrm{MEV}} is the gas price of the transactions; and sMEVs_{\textrm{MEV}} is their size, i.e. the total amount of gas they consumed. VoutV_{out}, VinV_{in}, and gMEVg_{\textrm{MEV}} are denominated in the base network currency (ETH), while sMEVs_{\textrm{MEV}} is in units of gas. Separating the gas term from VoutV_{out} will be helpful in quantifying the extraction costs, and it is also how we compute REVS\textrm{REV}_S in practice.

We use "the blockchain" loosely here to refer to any other addresses (corresponding to smart contracts or EOAs) that are not the EOA of the extracting transactions, or smart contracts controlled by the searcher. Note that identifying these is a heuristic-guided process based on known searcher patterns, and by all means fallible. Also, we stress that any ancillary transactions related to the MEV\textrm{MEV} extraction (like the "meat" in a sandwich attack) are not part of the set of transactions that contribute to the above variables.

Turning to the miner side, we have:

REVM=sMEV.(gMEVβˆ’geff),(3)\textrm{REV}_M = s_{\textrm{MEV}}.(g_{\textrm{MEV}}-g_{eff}), \tag{3}

where geffg_{eff} is the effective gas price of the transactions that would have been included in the block had the opportunity not been taken. REVM\textrm{REV}_M is thus defined to include the opportunity cost the miner incurs by including the MEV\textrm{MEV}-extracting transactions.

As transactions in the mempool are ephemeral, it is impossible to measure geffg_{\textrm{eff}} a posteriori from only blockchain data and logs. We resort to an approximation that also serves as a lower bound for the value realized by the miner:

REVM≳sMEV.(gMEVβˆ’gtail),(4)\textrm{REV}_M \gtrsim s_{\textrm{MEV}}.(g_{\textrm{MEV}}-g_{tail}), \tag{4}

where gtailg_{tail} is the gas price of the last transaction in the block4.

Plugging equations (2) and (4) we get for the total realized value:

REV≳Vinβˆ’Voutβˆ’sMEV.gtail.(5)\textrm{REV} \gtrsim V_{in} - V_{out} - s_{\textrm{MEV}}.g_{tail}. \tag{5}

In this rendition the miner and searcher roles are blurred, but we can clearly identify the extraction costs of the opportunity, given by the subtrahend sMEV.gtails_{\textrm{MEV}}.g_{tail}.

Finally, note that the value split between searcher and miner at this stage is entirely decided by the choice of gMEVg_{\textrm{MEV}}, which is in turn affected by the nature of the opportunity and the presence of other searchers trying to exploit it.

Including Externalities#

The scenario presented so far ignores the fact that while single-searcher successful value extractions exist, they constitute only a small fraction of all MEV\textrm{MEV} activity. In practice, each time an opportunity arises in the network, several searchers will try to take it by engaging in Priority Gas Auctions or submitting multiple competing transactions to backrun a target state change. Moreover, sometimes searchers perform onchain calculations to validate the existence of an opportunity ("preflights"). When these checks fail, there is no value extracted, but miners will still benefit from the collected gas fees.

Note, however, that all of this activity is zero-sum: all costs incurred by searchers by competing with each other, validating state, etc., directly becomes miner profit. From the miner's perspective, the fee paid by a searcher's preflight is no different from, say, the one coming from an unsuspecting token transfer. This goes to say that none of this value amounts to a contribution to the REV{\textrm{REV}}. However, it is of interest of us to quantify it, since it is precisely what generates trouble for regular users of the network not involved in this commerce.

We will then need to take a broader view of MEV\textrm{MEV}, and define a new term, the Extractable Value Cost (EVC{\textrm{EVC}}), which summarizes all the extra value induced by MEV\textrm{MEV} extraction activity, that is not part of the extracted value itself. With this definition, we have:

TotalΒ MEVΒ Activity=REVS+REVM+EVC.(6)\textrm{Total MEV Activity} = \textrm{REV}_S + \textrm{REV}_M + {\textrm{EVC}}. \tag{6}

In words, the total MEV\textrm{MEV} activity is composed of the extracted MEV\textrm{MEV} (REV\textrm{REV}, divided among searchers and miners), and the global costs of extractable value, going directly to miners and quantified by EVC{\textrm{EVC}}. Note that EVC{\textrm{EVC}} only encompasses on-chain activity, ignoring off-chain costs like network bloating due same-nonce transaction replacement.

We can compute the EVC{\textrm{EVC}} as follows:

EVC=βˆ‘tx∈Xstx.gtx,X={preflights,failures,cancellations}.(7){\textrm{EVC}} = \sum_{tx\in X} s_{tx}.g_{tx},\quad X=\{\textrm{preflights},\textrm{failures}, \textrm{cancellations} \}.\tag{7}

While altogether eliminating MEV\textrm{MEV} is likely impossible5, it is Flashbots' core mission to reduce the negative externalities of MEV\textrm{MEV}-related activities by improving the overall efficiency of the extraction process. The present framework allows us to state this mission concisely as that of reducing EVC{\textrm{EVC}}.

Flashbots Bundles#

Flashbots optimizes MEV\textrm{MEV} extraction by allowing searchers to submit bundles of ordered transactions, effectively transferring part of the ordering privileges from the miners to the searchers. These bundles are included by the miners provided they get more out of them than by mining regular transactions. While searchers can still set a gas fee, the preferred way to pay the miners for inclusion is via a direct coinbase transfer included in the bundle6.

We thus need to account for this extra term in our miner revenue formula (4):

REVMFlashbots≳sMEV.(gMEVβˆ’gtail)+Vdirect,(8)\textrm{REV}_M^{Flashbots} \gtrsim s_{\textrm{MEV}}.(g_{\textrm{MEV}}-g_{tail}) + V_{direct}, \tag{8}

where VdirectV_{direct} is the total value transferred to the coinbase address. Note that this new term doesn't affect the total REV\textrm{REV} as it is accounted for by a corresponding increase of the VoutV_{out} term.

Apart from the extra term, we now expand the set of transactions that contribute to the terms in the formula to include all transactions included in the bundle. In particular, if a bundle includes the "meat" in an arbitrage, its size and gas price count towards the extracted value. This ensures we account for the opportunity cost incurred by miners when including bundles instead of regular transactions.

Finally, expression (2) for searcher value stays the same, but also requires expanding the implied transaction set to all transactions in the bundle. The rest of the model remains unchanged by the utilization of Flashbots' bundles. With these changes, the model also encompasses alternative relay services like private mempools.

It is worth noting that Flashbots reducing EVC{\textrm{EVC}} does not imply a decrease in miners' revenue, since their share of extracted value might increase as a result of the extraction optimization. Flashbots executions are deterministic and therefore searchers are likely to pay the miners more than if they risked paying for reverts or cancellations. Finding the revenue sharing equilibrium is ultimately a game-theoretic problem which deserves independent treatment.

Final Thoughts#

By unifying various quantities involved in MEV\textrm{MEV} extraction, our framework enables us to pose clear-cut questions like "how big are the costs of MEV\textrm{MEV} extraction activities for the network?", or "to what extent has Flashbots helped in reducing these costs?". These and other interesting perspectives on MEV\textrm{MEV} extraction based on this framework will be included in coming versions of MEV\textrm{MEV}-Explore.

Throughout this work, we have swept under the rug the complications involved in actually measuring the "atomic terms" entering the definitions, like VoutV_{out}, or the actual set of MEV\textrm{MEV}-extracting transactions. This task involves ad hoc heuristics for an ever-growing number of MEV\textrm{MEV} extraction strategies, and while we strive for establishing a useful classification, there will always be unforeseen opportunities that will elude detection7.

We pass no judgment as of which types of MEV\textrm{MEV} extraction are "good" and which are "bad", although there's certainly ways in which this question could be meaningfully approached ("has an unrelated third party incurred loss due to the extraction?"). We leave this subtle question for future work, but we restate our belief that EVC{\textrm{EVC}} is undesirable and we shall strive to minimize it.

Join our Efforts!#

At Flashbots, we perform research and build systems for mitigating the upcoming MEV\textrm{MEV} crisis, and we would love your help. We are a distributed organization with the principles of a pirate hacker collective, and have several open positions. We also issue grants to external researchers doing work aligned with ours, please find out more in our Research repository, or join our Discord!

Special thanks to Scott Bigelow, Phil Daian, Stephane Gosselin, Alex Obadia, Tina Zhen, and Jason Paryani for welcoming me onboard and all Flashbots' crew for the work and discussions leading to this post.

  1. Note however that most of what is presented here should apply with minor variations to other blockchains that have actors with transaction-ordering privileges. Work is underway to flesh out these variations.↩
  2. The definitions here are consistent with a theoretical approach to MEV\textrm{MEV} to be published in an upcoming paper (sneak peek here).↩
  3. It's up for discussion whether the (non-measurable) MEV\textrm{MEV} should also depend on this.↩
  4. One would need to look into adjacent block gas prices if the entire block was taken up by MEV\textrm{MEV}-extracting transactions.↩
  5. Note however that it can likely be reduced to some extent with smart protocol design, there's some ongoing efforts to this avail.↩
  6. A direct coinbase transfer could also be present in a standard, non-bundled extraction, but it would make little sense for the searcher to do it since miners typically only look at gas prices for transaction inclusion and ordering.↩
  7. See this paper for a complementary, protocol agnostic approach to MEV\textrm{MEV} detection based on flagging certain types of "transaction dynamics" (displacement, insertion, and suppression).↩