MEV, or Maximum Extractable Value, is the maximum profit that can be gained from producing blocks. This is done by including, excluding, and reordering transactions in a block, and goes beyond the standard rewards and fees.
Let’s suppose that there’s a $50K arbitrage opportunity on Uniswap after a big trade resulted in a price discrepancy and has caused price slippage, a bot noticed this opportunity and submits its transaction to capture the profit and included $10 as a tip to get his transaction validated before anyone else but in this scenario, there are 2 cases that can happen:-
- A validator can block the transaction and submits his transaction to capture this arbitrage opportunity.
- Other bots might have observed this opportunity and may include a higher tip with the transaction to get it validated before any other transaction.
So, in the above case, $50K is the MEV, if the validator did not capture the transaction, and the transaction is initialized, the difference between the price at which the auction settles and the total MEV available is the winning trader’s profit.
The above graphic shows how transactions are processed on the blockchain. Transactions are held in the Mempool and validators select and validate them, then add them to the blocks. Validators have the power to validate transactions based on the economic incentive associated with them. However, in reality, most of the MEV activity is being done by independent parties called Searchers who use complex algorithms to detect profitable opportunities and automatically submit those transactions to the network.
Implementation of MEVs
DEX Arbitration
This is how Arbitrage works, let’s suppose, If there is a price discrepancy between 2 DEXes, the user will buy the assets from the DEX that is offering a lower price and sell it on the DEX that is offering a higher price. DEX arbitrage is the most simplest and renowned MEV opportunity and hence it attracts a lot of searchers, which makes it highly competitive. As DEX arbitrage is highly competitive, the searchers might have to pay 90% of their MEV profits in Gas fees to win the bidding gas war with other searchers and this is because the only way to get your transaction validated before anyone else’s is by paying highest gas fees than anyone. Here’s an example of profitable arbitrage where a user converts 1000 ETH into 1045 ETH.
Liquidations:
Lending protocols liquidation also provides an MEV opportunity. Lending protocols require users to deposit collateral to receive loans, and based on this deposited collateral, the borrower receives the loan amount, and this collateralization ratio depends on project to project basis. As the price of the borrower’s collateral decreases, the chances of the borrowed amount being more than the collateral deposited increases, this will trigger the liquidation process by the protocol, and these protocols allow anyone to liquidate the collateral deposited to be able to provide the lender back his money. If liquidated, the borrower usually has to pay a hefty liquidation fee, some of which goes to the liquidator — which is where the MEV opportunity comes in. Searchers had to compete to find out which borrowers can be liquidated and the first to submit a liquidation transaction and collect the liquidation fees.
Sandwich Trading
In sandwich trading, searchers look for big trades that can affect prices. For example, if someone wants to buy 1000 ETH with USDT, this can increase the price of ETH. Searchers identify these trades and calculate the price impact on the ETH/USDT pair. They then buy ETH at a low price and sell it for a higher price on another exchange or pair.
MEV in NFTs
MEV in the NFT space is quite a new phenomenon but it is growing, as NFT transactions are also published with the normal ERC20 transactions, so the searchers can use the same strategies as they use in the traditional MEV opportunities. Using similar methods, a searcher can program the transaction to front-run all other transactions or buy all the NFT collection in a single transaction, or if in some cases, an NFT is listed below its floor price by mistake, a searcher can take advantage of this and but that NFT for cheap.
Risks arising from MEV
On the blockchain level, frontrunners engage with each other in gas price auctions, when two frontrunners try to beat each other by continuously bidding higher and higher gas fees for their transaction to be included in the next block, this progressive gas price war results in network congestion and high gas prices for everyone else trying to run regular transactions.
If we take this problem to the block level, this bidding war to get your transaction validated before anyone else can have a damaging effect on the blockchain, when the MEV reward available in a block is much higher than the usual block reward, validators may try to take it for themselves by rearranging or re-organising blocks. This can lead to instability in the blockchain’s consensus.
On the Dapp layer, certain types of MEV strategies such as sandwich trading can result in a very negative outcome for the dApp users. Those who become sandwiched can experience higher slippage and poorer trade execution.
Current State of the MEV
Since DeFi gained popularity starting from the late 2020s, MEV extraction has been expanding rapidly which resulted in the extreme rise in gas prices on Ethereum. As MEV can be created any time a user interacts with a blockchain, smart contracts enable a functionally infinite number of potential interactions. Thus, it is computationally infeasible to calculate a blockchain’s total potential MEV by brute force. There is no definite method through which we can determine the total MEV that has taken place on Ethereum, all the MEV that we are currently aware of only constitute the lower bound.
Essentially, as the MEV extraction becomes more well known, more and more searchers would be fighting for the same opportunities and hence, the majority of this revenue would be coming straight into the wallets of validators, but due to this high competition on Ethereum, searchers are now shifting to other layer-1 blockchains like Binance Smart Chain, where similar opportunities exist but with less competition. The transition from proof-of-work to proof-of-stake, as well as the ongoing effort to scale Ethereum through rollups and sharding, all change the MEV landscape in unknown ways.
Conclusion
To combat the rising issue of MEV in DeFi, developing user-focused components through critical infrastructure and appropriate tooling at the dapp level is crucial. While there are various methods to address MEV, the most practical solution is to implement a trading mechanism that enforces batch auctions. Batch auctions allow multiple transactions to be executed simultaneously in the same block, reducing the chance of MEV. Another effective approach is submitting off-chain orders through signed messages, which are settled all at once in a single batch to prevent transaction replication and reorganization. As MEV continues to pose a significant challenge in DeFi, protocols that prioritize minimizing MEV, such as those using batch auctions, are the way forward. As a community, we should support these innovative products and protocols.