MEV stands for maximal extractable value, which refers to the amount of Including, excluding, and changing the order of transactions in a block captures the highest value from the production of the block.
Philip Daian and others first proposed the concept of "MEV" in the 2019 research paper "Flash Boys 2.0". MEV originally referred to "miner extractable value" at the time, because the paper focused on miners on the PoW chain. However, MEV exists in both PoS and PoW networks. Furthermore, third parties (MEV bots), rather than block producers, now capture most types of MEV. Therefore, the meaning of MEV gradually evolved into maximal extractable value, that is, the maximum extractable value.
In most blockchain networks, pending transactions are pre-stored in a public waiting area, called For "mempool" (mempool). Miners or validators select them from the mempool, sort them, and execute them in new blocks. Afterwards, the entire blockchain network will verify the new block produced. After the new block passes verification, the transactions in it are finally confirmed. MEV robots can profit from this process.
Who are the "miners"? What’s the point of mining? Please refer to the entry "What is Mining".
When the MEV robot is in the memory pool A sandwich attack occurs when a large pending transaction is detected and transactions are chosen to occur before and after this transaction. A sandwich attack reduces the amount of cryptocurrency the original trader will receive and allows the MEV bot to pocket the difference.
For example, Wayne is about to place an order on Uniswap to buy 10 ETH at $1,000 each, for a total of $10,000. Transactions sit in the mempool waiting to be executed. When the MEV bot discovers this transaction from Wayne, it can immediately place two additional orders to be included in the same block. The sandwich in the final block would look like this:
The additional cost to Wayne (the MEV victim) depends on the slippage he sets for his order. Slippage is the percentage of price difference between when an order is submitted and when it is executed that Wayne is willing to accept - the lower the slippage, the lower the reward for a potential sandwich attack.
JIT liquidity means that LP provides and removes liquidity from DEX immediately before and after a transaction . When the MEV bot observes a large pending transaction in the mempool, it can immediately add liquidity to the DEX and focus on the exchange range where the pending transaction will occur. After completing the transaction through JIT liquidity and earning LP fees, the MEV robot immediately removes the LP position from the DEX.
JIT liquidity is like a reverse sandwich attack on traders, with the original trader benefiting from better trading conditions.
What is liquidity? What is LP? What significance do they have for DEX? Please refer to the entry "What is Liquidity and LP (Pool)".
Cryptocurrencies often have different prices on different decentralized exchanges. When there is a large price difference between exchanges, the MEV bot can buy from the lower price exchange and sell on the higher price exchange to make a profit. Therefore, through the continuous arbitrage of MEV robots, prices are more consistent between exchanges, making the DeFi market more efficient.
When a borrower is unable to repay a loan on a DeFi lending protocol, the protocol allows anyone to liquidate the collateral of an insolvent borrower and Earn liquidation fees. MEV robots usually jump at this opportunity.
What is the mechanism for liquidation? What's the point? Please refer to the "What is Liquidation" section.
The main way for MEV robots to compete for MEV opportunities is to compete for gas fees. Transactions with high gas fees have higher priority and will be executed before transactions with lower gas fees. Therefore, MEV bots can manipulate the order of transactions within a block by changing the transaction fees paid to block producers. In other words, the only way to ensure that MEV transactions go through is to submit the highest gas price.
Thus, although miners and PoS validators did not actively seek MEV arbitrage, they were able to pocket the majority of MEV profits. For example, some MEV bots will pay gas fees of 90% or more of their total MEV profits to beat other bots to potential MEV opportunities.
Some forms of MEV harvesting are harmful to blockchain networks and their users, while other forms are beneficial. For example, victims of a sandwich attack suffer from price increases. On the other hand, DEX arbitrage MEV provides users with more accurate prices, and the rapid liquidation of lending agreements allows the lender’s property security to be better protected.
You may be interested in the following:
- What is a flash loan?
- What is a loan?