This article will discuss the topic of MEV bots, which are a series of individuals who exploit powerful hardware and specially designed techniques to make a profit in the business of producing blocks in the Ethereum blockchain.
This is a very complex topic, and an initial introduction to the topic of block validation in Ethereum is necessary again to be able to understand what MEV bots are and why it is interesting to talk about them.
All the details below.
An initial premise: the role of the validator and searchers
While it is understood that MEV techniques can also be used on other networks, in this article we will focus exclusively on the Ethereum chain so as not to create confusion.
On it, all transactions are initially grouped in the mempool, waiting to be grouped and added to a block, before actually being published.
Up to that point, the transactions remain pending and the crypto assets are not made available to the user who is to receive them.
The task of producing the final block is up to the validator (with proof-of-work it was the miner) who can independently choose which transactions to include first.
At this point it is IMPORTANT to understand that the figure of the validator gains from this activity in two ways: from the block reward (in the case of Ethereum, 2 ETH per block) and from the TX fees of users who want to have priority of execution.
Hence, it is in the validator’s interest to choose the transactions that “pay the most” and create a block that rewards it the most in terms of tx fees.
Consider that sometimes these exceed the amount of the block reward.
The essence of the EVM, which we will discuss in more detail in the next section, is based on this very concept, namely, the fact that the block producer can sort the transactions in a block at will, making them execute according to a certain chronology that will then have certain effects on the market.
Another very important figure in this process is that of searchers, i.e., individuals who provide a “package” to the validator with a possible ordering of transactions, so as to simplify the work for it.
This is an already preset transaction combination that validators can exploit to earn as much from TX fees as possible, while rewarding the searchers with a commission for their work.
However, the gain for searchers lies not so much in the commission they are entitled to, but in the effects that are caused when a validator chooses to publish their proposed block version.
In fact, by doing so, the searcher can take advantage of arbitrage opportunities on the DEX by choosing to order transactions in such a way as to create slippage on the price of an asset and take advantage of this price difference.
Then there are other techniques that searchers and validators can exploit, sometimes trying to rip each other off by following the profit motive exclusively
The operation of Ethereum MEV bots in detail and the value creation process
After the initial preamble, we can finally talk about MEV bots on Ethereum.
The term “MEV” refers to “Maximum Extractable Value,” which is that set of techniques that seek to maximize the profit of an individual (whether a validator, searcher, or relayer) by choosing to include, omit, or reorder certain transactions in a blockchain.
Since the Ethereum blockchain is subject to the use of smart contracts and is full of decentralized marketplaces ranging from simple DEX to lending platforms, we understand well that choosing the ordering with which multiple transactions can be executed totally changes the end result, especially when large amounts of cryptocurrency are involved.
It is not always the validator who gains based on the sorting of tx in a block: although this party earns the block reward and user tx fees, sometimes other players benefit leading to multimillion-dollar profits even at the expense of the validators themselves.
It is good to understand that the person who exploits these EVM techniques is not just any user, but an expert who uses very complex hardware and specialized software in identifying the best strategy and carrying this out in an automated way.
We can summarize all EVM techniques in the following cases:
- asset price arbitrage on different decentralized markets;
- frontrunning or sandwich attacks;
- loan liquidations in DeFi.
Let’s try to delve into the second case, that is, frontrunning attacks: by exploiting the capabilities of the individuals involved in block publishing, it is possible to anticipate a significant purchase order (previously left pending in the mempool) to create an increase in the price of an asset, and always exploit the logic of transaction ordering to place a sell order in the next instant and sell the same asset at a higher price than the initial one.
This is more specifically referred to as a sandwich attack when a buy tx is placed before a major order (e.g., a purchase of 1000 ETH) and a sell tx is placed immediately after.
The slippage caused by the whale order represents the profit of the MEV strategy.
The world of EVMs is extremely complex, and these examples we have provided represent only the tip of the iceberg of a much more complicated set of strategies and techniques that have been carefully crafted to try to make a profit.
In any case, it is important to remember that when a validator or searcher profits from such a trade, for example by “artificially” creating a price slippage on a DEX, there is always a counterparty that loses the same dollar value.
Here too, as is the case in trading, the game is zero-sum: when it comes to money, there is no ethics.
The pros and cons of the MEV techniques used by bots on Ethereum
You are probably wondering what the advantage is of having a structure of bots on Ethereum that exploit MEV strategies, sometimes playing dirty, to get rich behind someone else’s back simply by managing the sorting of tx in a blockchain.
There are different currents of thought that praise or criticize the essence of MEVs and these strategies.
Those in favor of MEV bots mainly believe that this kind of on-chain activity and competition promotes stable asset prices in DeFi protocols and makes lending platforms less dangerous.
It is precisely because of the MEV bots that on Sushiswap and Uniswap, for example, the price of ETH is more or less always the same and no major variations occur that would harm trading on these protocols.
In fact, arbitrage opportunities are also and mainly generated by MEV strategies, but they are in fact exploited and concluded within the same block i.e. a few thousandths of a second later.
On the other hand, those who are against these maximum value extraction techniques argue that the user experience is definitely more unpleasant given the gas price increase caused by MEVs on Ethereum.
In the struggle to get the tx sorting preferred, individuals involved in this process increase tx fees to the point of forcing even simple users who want to make a simple cryptocurrency transfer to pay disproportionate fees.
In addition, some whale in carrying out on-chain crypto buying or selling transactions might suffer greater than normal slippage if he or she were targeted by a MEV, who for his or her part would earn the price difference caused.
In conclusion, MEV strategies represent an interesting insight into Ethereum’s blockchain architecture and the roles inherent in blockchain organization.
To date, this set of techniques is looked upon favorably by the Ethereum community, but as the ecosystem is constantly evolving, insiders are constantly monitoring the situation to prevent MEVs from threatening the consensus and integrity of the network, which has always been preserved so far.
We will see what the future of these bots on Ethereum will be and whether Vitalik and his own foundation will allow them to evolve or create solutions to destroy them.