Author: Dan Robinson, Dave White

Compiled by Joyce, BlockBeats

introduce

In this post, we introduce the MEV tax, a mechanism that any application can use to capture its own MEV. This mechanism is available today on OP Stack L2s like OP Mainnet, Base, and Blast, because block proposers on these chains follow a set of rules we call competitive prioritization.

To impose a MEV tax on one of the chains, the smart contract charges a fee that is a function of the transaction’s priority fee. If the application charges $99 in MEV tax for every $1 in priority fee paid by the searcher, it can capture 99% of the competing MEV for that transaction.

MEV taxes are a simple technique that opens up a vast design space. You can think of them as allowing any application on the chain to run its own custom MEV auction without requiring any of its own off-chain infrastructure, simply connecting to a single shared auction run by block proposers.

We describe how a MEV tax can be used to address three main issues in MEV research:

Decentralized exchange (DEX) routers optimize the prices exchangers receive;

Automated Market Makers (AMMs) that minimize the loss and rebalance (LVR) experienced by liquidity providers;

A wallet that lets users capture any “background running” MEV created by their transactions;

But there’s a catch. The MEV tax only works if block proposers strictly follow the competitive prioritization rules, which include ordering transactions by priority fee and not censoring, snooping, or delaying any transactions. If block proposers deviate from these rules, they can evade the MEV tax and capture the value for themselves. As a result, today, the MEV tax relies on trusted L2 sorters and may not work at all on Ethereum L1, where block construction is dominated by competitive builder auctions that maximize proposer revenue.

Nonetheless, the power and flexibility of MEV taxes suggest that prioritization may be the right choice for platforms that can currently offer this service. The relative simplicity of competitive prioritization suggests that there may be a viable way to enforce it in a decentralized manner without having to trust a single sorter. We hope this post inspires further research into this problem.

Prioritization

When someone sends a transaction on Ethereum L1 or L2, they specify a priority fee, which is paid to the block proposer. You can imagine this being specified as priorityFeePerGas, a number that is multiplied by the Gas used in the transaction to get builderPriorityFee — the total payment expressed in ETH.

There is no requirement in the Ethereum protocol that transactions in a block must be greedily sorted in descending priorityFeePerGas. However, this is a popular way to build blocks - for example, it is the sorter of the OP Stack chain and the default algorithm used by geth and reth. Priority sorting not only allows transactors to effectively express the urgency of their transactions, but also allows certain types of MEV to be naturally passed to block proposers.

This happens because priority sorting turns the competition for MEV into a priority gas auction. When there is an opportunity to profit from interacting with a chain, such as arbitrage with centralized exchanges through an AMM, searchers compete to get first dibs. If the chain uses priority sorting to determine transaction inclusion and ordering, searchers compete by setting high priority fees for their transactions.

In a competitive scenario where the risk-free profit race is zero, the winning searcher should eventually pay the full MEV priority fee. So if there is a profit of 100 ETH that can be gained by interacting with the contract, the first transaction to claim that profit will set a priority fee of 100 ETH. (We discuss some caveats in the limitations section).

MEV Tax

Suppose a smart contract wants to capture MEV from any transaction it interacts with. There is a ton of research on different application-specific ways that smart contracts can try to capture their own MEV.

But in fact, we don’t necessarily need to know anything about the application. If we know that the block was built via competitive prioritization, then we have a general signal about the amount of MEV in the transaction: the priority fee.

We propose that a smart contract could look at the priority fee of a transaction and charge its own fee as some increasing function of it. For example, a contract could require the caller to transfer applicationPriorityFee = 99 * proposerPriorityFee in ETH to the contract.

This new fee is paid by the searcher sending the transaction, so it affects the behavior of that searcher. If there are 100 MEV in the opportunity, the winning transaction will now only set a priority fee of 1 ETH, because this will result in a total payment of 100 ETH (1 ETH paid to the block proposer and 99 ETH paid to the smart contract). Any higher priority fee will make the transaction unprofitable; any lower priority fee will result in losing the opportunity to a competitor who set a higher fee. This means that the smart contract has captured 99% of the MEV in the transaction.

We call this additional fee imposed by smart contracts the MEV tax. The MEV tax allows applications to hijack prioritization for their own benefit, allowing them to recapture MEV for their users instead of leaking it to block proposers.

If this fee grows fast enough as a function of priorityFeePerGas, then the proposer will receive only a negligible amount of MEV. Since priorityFeePerGas is denominated in wei (one billionth of 1 ETH), we have a lot of precision to work with. For example, as long as the MEV tax is sensitive enough, a priorityFeePerGas of 50,000 will result in too high a tax, and the total amount paid to the proposer will be less than $0.01. (5)

However, there is an important caveat. As discussed in the “Limitations” section, the MEV tax only works if block proposers follow certain rules (which we call “competitive prioritization”) and do not deviate from those rules to maximize their own revenue. Enforcing these rules in a trustless manner is an open problem.

Single Application MEV Capture

Here we outline how, on chains that guarantee block construction using competitive priority ordering, the MEV tax can be used to mitigate three important issues in MEV: allowing DEX interfaces to improve trade execution for exchangers, allowing AMMs to reduce arbitrage losses to their LPs, and allowing wallets to reduce users’ MEV leakage by selling users’ reverse run rights.

Decentralized exchange router

In intent-based DEX routing protocols like UniswapX and 1inch Fusion, a user (Alice) signs an exchange intent and searchers compete to route or fill that intent for Alice at the best price.

The current version of UniswapX uses two mechanisms to conduct competition: a Dutch auction, where Alice’s limit price changes over time until it is filled by searchers, and an initial off-chain request-for-quote (RFQ) auction, which is used to set the starting price of the Dutch auction.

On a platform that guarantees competitive prioritization, UniswapX can replace these mechanisms with a single one: the MEV tax. It can do this by letting users sign orders that can be filled instantly by anyone, but the execution price is set as a function of the priority of the trade.

For example, if Alice has a UniswapX order to sell 1 ETH, she can define the execution price of the order as minimumPrice + ($0.01 * priorityFeePerGas). The minimumPrice could be some fixed value that she expects to be significantly lower than the current price.

Searchers will compete to fill Alice's order by submitting transactions. Whichever transaction has the highest priority fee and does not revert will fill the order, which should guarantee that exchangers get the best price that searchers can find. (Some exceptions are discussed in the "Limitations" section.)

If Alice's minimum price is $3,000, and the current price of ETH is $3,500, the priorityFeePerGas in the winning transaction is about 50,000. (Note that in a transaction that costs 200,000 Gas, this would result in a payment of only about 10 billion wei (about $0.000035) to the block proposer.)

This has some potential benefits over the existing mechanism used in UniswapX.

Orders using the MEV tax can be completed faster and at a better price than orders using a Dutch auction. As discussed in the article, on-chain Dutch auctions leak some value into MEV due to price movement between blocks and can take many blocks to complete. In contrast, orders using the MEV tax can often be completed in the next block while capturing the vast majority of MEV.

Unlike off-chain inquiries, auctions for orders using MEV taxes will be automatically conducted when on-chain transactions are executed. This means that the winning bidder is guaranteed to only commit to filling the order if the on-chain transaction is successful. This can make on-chain liquidity such as AMMs more competitive with off-chain liquidity, which means UniswapX can serve as a more efficient router for multi-pool systems such as Uniswap v4.

AMM

Normally, AMMs leak value to arbitrageurs who trade based on outdated prices at the top of blocks, as discussed in the Losses and Rebalancing paper. We can use a MEV tax to allow AMMs to capture MEV. For simplicity, we’ll discuss how to play on AMMs without centralized liquidity. (If you’re interested in how to solve this kind of problem with centralized liquidity, Sorella will be releasing a solution soon.)

AMMs can capture MEV by charging an additional fee as a function of the transaction priority fee, allowing them to auction the right to be first in a block. There are multiple ways to calculate and denominate this fee. We will discuss one that is arguably neutral - in units of pool liquidity, sqrt(xy). The winning transaction will be the one that increases the pool liquidity the most.

When the first transaction is executed on the pool in a block, instead of enforcing the condition x_end * y_end > x_start * y_start , the pool can enforce the condition (with a as some constant):

x_end * y_end > (sqrt(x_start * y_start) + a*priorityFeePerGas)^2

This formula will incentivize arbitrage traders to trade at the true price, and after that trade, the midpoint price in the pool should be the true price.

After the first trade, trading can proceed just like on Uniswap v2 with a fixed swap fee. Uninformed traders who want to trade in the pool without paying the additional MEV tax will have a lower priority fee set.

There are many other ways to implement a MEV tax on an AMM that would have different effects. For example, a MEV tax could be denominated in the input or output tokens of a swap, could affect the swap fee percentage applied by the pool, or could establish a minimum price for users to trade. We think this is an interesting design space worth exploring.

Reverse auction

The above description shows how certain applications can be designed to avoid MEV leakage. However, what if a wallet wants to try to help users capture the MEV they create from any transaction they interact with any application, even those that do not include the MEV tax?

For example, when Alice makes a large trade on an AMM, she sometimes creates arbitrage opportunities for “backrunners”, pulling the price back in. This is usually leaked to the MEV, not to Alice.

MEV-Share and MEVBlocker are two protocols that allow users to capture MEV from transactions, but they rely on complex off-chain auction systems. The Order Flow Auction Design Space describes some other solutions.

The MEV tax combined with intent-based smart contract wallets allows us to build an alternative system to capture MEV for Alice running in the background. Let’s assume that Alice does not create a transaction to make a trade on the AMM, but instead signs an intent that anyone can submit to Alice’s smart contract wallet to make them take that action. Alice’s smart contract wallet charges a MEV tax to anyone who submits that transaction, which is paid to Alice.

Searchers who submit Alice’s intent will have the exclusive right to run her back, since they can do so automatically in the same transaction. Therefore, if the search is competitive, all of Alice’s profits should go to Alice via the MEV tax.

Note that this system does not necessarily protect users from attacks involving front-running a user's transactions, as the front-running user's transactions may be able to avoid paying the MEV tax to that user. This issue (and some possible mitigations) are discussed in more detail in the Limitations section below. Nonetheless, this can at least be an improvement over systems that use a public mempool and do not have any mitigations.

Other Use Cases

Beyond these examples, other potential uses of the MEV tax could include pretty much anything that currently uses off-chain or Dutch auctions, such as:

Oracles capture protocols whose creations oracle extract value, such as Oval;

Refinancing auctions for NFT mortgage protocols such as Blend;

The leakage value of lending protocol liquidation is lower than that of Dutch auction;

Cross-application MEV capture

The above solutions are designed to capture MEV interactions with a single application. But sometimes a searcher might be able to extract more value by interacting with multiple applications in the same transaction.

If only one of these applications has a MEV tax, then all MEV in the transaction should go to the application with the MEV tax, no matter how high or low the MEV tax is.

But what if the Seeker’s transaction interacts with two applications that use the MEV tax? For example, what if there is some MEV that can only be captured by filling one of the above MEV-taxed UniswapX orders against a MEV-taxed AMM?

In this case, the relative amount of excess MEV captured by each application depends on how those applications set their MEV taxes. If the value app_i collected as MEV tax is given by the function tax_i(priority), then the priority of the winning transaction can be determined by solving the priority in the following equation:

tax_1(priorityPerGas) + tax_2(priorityPerGas) = total MEV

(Technically, we could add a third term to priorityPerGas * gasUsed to account for the priority fee paid to the block proposer, but we will ignore this and it is probably negligible in normal circumstances)

In the simple case where the MEV tax is linear in priorityPerGas (so tax_1(priorityPerGas) = ​​a_1 * priorityPerGas), you can solve for the share of MEV each application receives:

a_1 * priorityPerGas + a_2 * priorityPerGas = MEV priorityPerGas = MEV/(a_1 + a_2) tax_1(priorityPerGas) = (a_1/(a_1+a_2))*MEV tax_2(priorityPerGas) = (a_2/(a_1+a_2))*MEV

Applications face a tradeoff when setting their own MEV taxes - a higher tax lets it get a larger share of cross-application MEV when it occurs, but means it may miss out on some cross-application MEV if there are competing ways to extract it. For example, if there is an AMM that charges a MEV tax on every trade, then a MEV-taxed UniswapX order might be more likely to be filled by a different AMM or off-chain filler.

In many cases, there may be an equilibrium where two applications design their MEV taxes so that MEV is shared in a way that maximizes their respective profits. For example, a MEV-taxing AMM may want to capture value from a single informed trader near the top of a block, but then want to provide liquidity to other traders and applications (including applications using the MEV tax) at a lower fixed rate fee. In this case, the AMM might set a relatively low MEV tax (e.g. $0.00001 * priorityFeePerGas) so that arbitrage trades (if any) occur early in a block, and then charge no MEV tax on subsequent transactions in the block. An application like UniswapX that wants to interact with the AMM could set a higher MEV tax (e.g. $0.01 * priorityFeePerGas) to ensure that its trades are included after the pool has already arbitraged. Given these relative taxes, the AMM will eventually be arbitraged first even if there is only $1 of MEV and $50,000 of MEV in the UniswapX order book.

We believe this is a broad design space worthy of future research.

limitation

There are some complexities and shortcomings with the MEV tax that we believe are interesting areas for future research.

Incentive incompatibility

MEV taxes are not incentive compatible for monopoly block proposers. They only work if there is fair competition for transaction inclusion, and this only happens if block proposers follow a rule we call "competitive prioritization" instead of maximizing their own revenue. Informally, some suggested rules include but are not limited to the following:

Priority sorting. Transactions within a block must be sorted in descending order of priorityFeePerGas.

Censorship resistance. If a block proposer receives transaction t1 during a block, and the block is not full or contains some transaction t2, such that t2.priorityFeePerGas < t1.priorityFeePerGas, then the block must include transaction t1.

Pre-transaction privacy. Block proposers must accept transactions through a private endpoint and may not share such transactions with anyone else before submitting them to a block, or use the contents of these transactions as input to construct their own transactions.

There is no final review. Block proposers must set a clear block time before which they accept transaction requests from anyone; after which they no longer accept transaction requests from anyone.

Violating one or more of these properties could undermine the effectiveness of the MEV tax. A block proposer that violates censorship resistance could avoid most MEV taxes by excluding competing transactions and submitting zero-priority transactions that take advantage for themselves. A block proposer that violates pre-transaction privacy could steal MEV from other transactions or look at their priority fees to know exactly how high they need to set their fees, while a block proposer who is able to submit transactions later than others would get a free “last look” at whether to outbid others, both of which could create adverse selection problems that ultimately hinder competition.

Unfortunately, while the first property is easy to enforce at the protocol layer, enforcing the others in a trustless manner is an open problem.

In the absence of enforcement at the protocol level, a single sequencer that commits to these rules needs to be trusted not to deviate from them, and if proposers outsource block construction to competitive revenue-maximizing auctions (such as Ethereum L1’s MEV-Boost), blocks may not follow them.

These problems can be "solved" by a single trusted sorter that commits to block construction using competitive priority ordering. They can also be solved by decentralized mechanisms that use some combination of consensus, cryptography, and/or trusted execution environments, such as Sorella's Angstrom, Flashbots' SUAVE, leaderless auctions, or multiplicity.

Full Block

One exception to the normal operation of the MEV tax occurs when a block is completely full. In this case, block proposers may have to discard lower priority transactions rather than simply include them in the block. Since transactions that interact with MEV tax applications may have extremely low priority fees, these applications may be squeezed out by applications that do not use the MEV tax or have extremely low MEV taxes. However, in a chain that uses a mechanism like EIP-1559 to set a separate base fee, the situation where the block fills completely should be relatively rare. Additionally, given that some transactions need to be delayed when blocks are full, delaying transactions that represent lower urgency by setting a higher MEV tax may be a reasonable outcome.

Restored transactions

The MEV tax actually relies on single-block auctions, where each "bid" is a transaction. A downside to these auctions is that failed bids often result in a reverted transaction being included on-chain, paying some base fee and causing chain congestion.

If the sequencer could exclude failed transactions entirely, this would alleviate this problem, although this is difficult to achieve even with a centralized sequencer. (It would also not strictly adhere to the censorship resistance property described above, although that definition could be adjusted.) More sophisticated sequencers could optimize this process by allowing transactions to specify which controversial auctions they are participating in, giving the sequencer enough information to skip subsequent transactions that it knows will fail.

Disclosing user intent

The MEV tax only works if there is competition between searchers, which means the opportunity needs to be known to some degree. For applications like AMMs, where the opportunity is visible on-chain, this should happen naturally. But for applications like intent-based routing or backend auctions, this means the application may need to share the user’s intent with the searcher.

In some cases, the temporary privacy loss caused by broadcasting user intent before it is fulfilled can leak value in ways that the MEV tax cannot recover.

For example, suppose Alice wants to buy a low-liquidity token using the backend auction protocol described above. She issues a signed intent to the smart contract wallet to buy that token on the AMM, setting a certain slippage tolerance. Seekers can compete in high-priority transactions to drive the price of that token up to her slippage tolerance without filling the user's order. The winner, Bob, can then satisfy Alice's intent in a non-competitive manner by including it in a low-priority transaction and running it in reverse, thereby sandwiching Alice's transaction and giving her a worse price while evading her MEV tax. Similar problems can also occur with purchasing NFTs.

It is important to note that such an attack is risky for Bob, because he cannot guarantee the atomicity between buying the token and selling it to Alice. A naive Bob may fall into a "pinch-and-tear" trap: Alice first publishes an intention to buy a worthless token from him, Bob buys the token in order to pinch her transaction, but before Bob completes the pinch, Alice withdraws her intention.

Apps can also mitigate this by limiting the set of searchers that share their intent and monitoring their behavior, as many existing order flow auctions do.

It would also be possible to combine a MEV tax with privacy-minded builder functionality, as Flashbots envisions for SUAVE’s design.

Finally, if Alice decides that the cost of sharing her intention outweighs the benefits of competitive search, she can construct the transaction herself and submit it directly to the block. As described above, an ideal implementation of competitive prioritization would provide pre-transaction privacy to block proposers.

Related Discussions

Priority gas auctions. The Flash Boys 2.0 paper, which coined the term “miner extractable value,” examined some of the dynamics of prioritization in decentralized blockchains. The paper noted that Ethereum miners (when the network used proof-of-work) already prioritize transactions, and that arbitrageurs relied on this behavior to participate in “priority gas auctions,” where they bid for the right to be included in the first block, which resulted in the majority of MEV arbitrage on decentralized exchanges going to miners.

First come, first served. Some attempts to mitigate MEV through transaction ordering rules, such as Themis or Arbitrum One’s current orderer (7) focus on enforcing a different ordering rule, first come, first served (sometimes called “fair ordering”), where block proposers must order transactions in the order they see them.

Prioritization takes a different approach - treating transactions arriving in a given time equally and sorting them by their declared priority.

First-come, first-served is difficult to enforce or even define in a real network environment with multiple validators. Even with a single trusted sorter, it can lead to wasteful latency contention and spam. Finally, a MEV tax may be able to eliminate certain types of MEV that first-come, first-served sorting cannot, such as arbitrage profits from discontinuous "jumps" in asset prices. The potential advantage of priority sorting over first-come, first-served sorting is somewhat related to the advantages of discrete-time over continuous-time exchange discussed in Budish, Cramton, and Shim (2015).

At the same time, while prioritization by default seems to leak value to MEV, this post shows how applications can be designed to regain it.

Fee Sharing. Blast is an Ethereum L2 that shares a portion of the Priority Fee and Base Fee with the smart contracts accessed in the transaction.

MEV taxes allow something similar (at least for priority fees), but can be implemented at the application layer on any chain that uses competitive prioritization, without requiring special support for fee sharing. They also allow applications to define their own taxes as custom functions of the priority fee, allowing greater flexibility and potentially increased composability of MEV-aware applications.

Trustless Solutions. This article focuses on the motivations for platforms to use competitive prioritization and methods to exploit it, rather than discussing how to enforce it in a trustless manner.

Each of the other properties required for competitive prioritization has been discussed previously. For example, in Fox, Pai, and Resnick (2023), the authors discuss the vulnerabilities of on-chain auctions in the absence of censorship resistance and describe the design of censorship-resistant auctions using multiple concurrent proposers. However, they do not recommend a specific ordering of transactions.

There is other research on building trust-minimized blocks, including SUAVE by Flashbots, Angstrom by Sorella, Leaderless Auctions, Decentralized Timeboost by Espresso and Offchain Labs, and Mandatory Public Transaction Inclusion by Péter Szilági.

We hope this post encourages L2 to consider prioritization (which is supported by default in the OP stack), and encourages applications to try MEV tax where supported. We also hope it inspires further research into trust-minimizing competitive prioritization protocols on L1 and L2.