Explanation of MEV, most popular strategies and user involvement.
MEV stands for Maximum Extractable Value. Initially, MEV was referred to as Miner Extractable Value. It was used extensively by Ethereum miners. By including, reordering, and censoring transactions within blocks, MEV aims to extract additional value (profit).
MEV is not limited to miners in proof-of-work (PoW) blockchains but also applies to validators in proof-of-stake (PoS) and other types of networks. PoS involves validators and depends on their behavior. Validators can choose in advance which transactions to include in their block. In fact, PoS opens up even more opportunities for the MEV, while at the same time increasing the revenue from the sharing of fees between competing validators.
There are several famous MEV strategies.
The arbitrage strategy involves placing two transactions alongside a target swap transaction. The MEV opportunity is created by a trader's transaction that affects a token price on DEX, such as Uniswap. This trade is visible on the mempool once initiated. Bots make a buy transaction on another DEX, where the token price is lower, to sell it back on the target DEX, where the price has risen after the trader's buy order is executed.
The front-running strategy aims to place the MEV transaction first in the execution queue, ahead of a known pending transaction. For instance, bots search for large orders on DEXs and submit competing transactions with higher gas fees to be executed before the targeted transaction.
Sandwich strategy refers to manipulating an asset price. Mev is extracted by placing two transactions, one before and one immediately after the target trader's transaction. For example, the attacker can identify the token and place a transaction before the trader's buy order in order to push the price higher. The second (sell) transaction will be placed immediately after the trader's transaction, which will push the price up even further.
The back-running strategy involves placing the MEV transaction next in order after an attacked pending transaction. Back-running bots monitor the mempool for any new token pair listings or liquidity pools that are created on the DEXs. When this opportunity is detected, the bot can immediately place an order to buy as many tokens as possible, while still leaving a small amount available for purchase. The bot then waits for the price to rise after traders have bought to sell the tokens it controls.
This strategy involves Liquidators who specialize in extracting MEV by liquidating over-collateralized loans. Bots define such opportunities to place a liquidation transaction before other competing transactions to profit from fees usually paid by protocols like Compound, Maker, and Aave.
MEV Bot refers to scripts of varying complexity that execute transactions according to algorithms and strategies to extract MEV from opportunities created by other market participants.
The main goal of the MEV Bot is to find MEV opportunities. What does this mean? Let's look at the arbitrage strategy. There are two liquidity pools: Uniswap and another DEX like Sushiswap.
We know that a swap transaction will affect the price between Token A and Token B on Uniswap V2, but not on another DEX like Sushiswap... at least not until someone takes advantage of the arbitrage opportunity. Once that transaction is mined, Token A will be cheaper on Uniswap than on Sushiswap, so whoever can sell Token A on Sushiswap for Token B and then sell those Token Bs on Uniswap for Token A should end up with more Token A than they started with. And that is exactly what this example illustrates.
In fact, MEV bots attack transactions indirectly and cannot steal your money. Searchers and MEV bots look for opportunities to extract value from the transactions placed by various players in the market. Some of this manipulation can affect the price and therefore the traders. However, due to the inefficiency of the swap route or other issues related to liquidity aggregators, users can sometimes suffer huge losses. Here is a real case of a $2 million loss due to the inefficiency of the swap route used by the user.
Fortunately, protocols and users using Wallchain for their transactions would be guaranteed to get their money back in the same transaction.
Individuals looking for MEV opportunities on the blockchain are called searchers. Searchers can be anyone using the blockchain who wants to make a profit by applying one of the MEV strategies. Some of them have enough knowledge to write scripts (MEV Bots). Others are working with Bot providers that provide all the functionality that is needed to attack the transactions of unsuspecting users.