MEV Bots: An Overview

Juanbug
4 min readMay 26, 2022

What is MEV?

MEV is a measure of the profit that a miner can make through their ability to include, exclude, or reorder transactions within the blocks they produce.

To understand how this works, we must first understand how ethereum transactions occur on the blockchain. When buying ethereum on the blockchain, the user signs off on a transaction, and it gets sent to a node before being included in the blockchain. Nodes place your signed transaction into a pending transaction pool referred to as the mempool. Miners will then select transactions from this pool that they assemble into a single block. All the transactions included in this block are then calculated to create a new blockchain state. Before the block is published, the block is mined to verify the new blockchain state.

Miners can decide which transactions get included in any particular block, and there is no obligation to include any specific transaction. They are more likely to include your transaction at an increased price. They also decide how many transactions get included in any singular block. The only rule is that they may not exceed the maximum gas limit of the block (200). Therefore, all miner decisions are highly economically motivated and leave the miner attempting to discover what bundle of transactions will earn the most significant profit. Finally, the miners are also able to decide the order in which transactions get executed in the final block, and these transactions do not have to be included in the same chronological order they were submitted.

MEV is the profit that any miner gains from being able to select and order transactions. Therefore, by being a miner and controlling the order in which transactions exist within a block, they can benefit themselves in a way to increase personal profits. For example, if a miner constructs a block containing their “sell” and others’ “buys,” they can arrange the order to include the “buys” first, driving up the price and then their “sell.” The miner deliberately makes the other users’ swaps less efficient to improve their own transaction; this is called an “extractable.” Another example is when the miner sees a transaction in the mempool that will end up being profitable and duplicates the transaction for themselves to get the profit instead.

Current Overview of MEV

The defining feature of Ethereum currently is that most miners are not attempting to exploit MEV themselves. Non-mining traders drive most current activity, but miners can only capture some MEVs due to their ability to order the transactions.

We are currently unable to say how much MEV is on Ethereum in total because MEV can be created any time a user interacts with the blockchain. The smart contracts enable a functionally infinite number of potential interactions making it impossible to calculate a blockchain’s entire potential MEV. However, we can establish a baseline by adding the MEV that’s known to have been extracted. From this amount, we are able to infer how much higher the actual lower bound could be.

Why does MEV Exist

MEV exists solely because there is no way to get rid of it. Implementing any formal transaction ordering in a distributed, fault-tolerant system would cause many problems. All of the people monitoring the transactions would be required to determine which arrived first down to fractions of seconds. They would also be required to make decisions on what happens with transactions submitted simultaneously.

Is MEV Good or Bad?

MEV can end up causing harm to both users and ethereum.

MEV can serve as an invisible tax that miners collect from users. If a profit opportunity is created, the bot would recognize the user’s transaction and sandwich their transaction between a buy and a sell. The MEV is levying an invisible tax on the user as their order is manipulated into executing at an inflated price that the miner sells for an instant profit.

It can cause the consensus to be more unstable. If block rewards are smaller in comparison to MEV, it may be more rational for miners to take that money for themselves and destabilize the consensus. Destabilization can be done by re-mining previous blocks to gain the MEV that existed in those.

Flashbots

Flashbots is a research and development organization formed to mitigate the negative externalities of MEV extraction techniques and prevent existential risks posed by MEV on blockchains like Ethereum.

They have built out tooling to quantify MEV and eliminate the information. They are attempting to implement a concept for permissionless MEV extraction called MEV-Geth for communicating transaction order preference.

To achieve this, they are focusing on three aspects:

  1. Flashbots auction is a private communication channel for transparent, efficient MEV extraction between miners and searchers.
  2. Flashbots data is a suite of tools for increasing MEV transparency and reducing information asymmetry.
  3. Flashbots research is an open, transparent, and collaborative effort to tackle short and long-term research questions about MEV.

In conclusion, MEV is being used by miners to gain profits individually and can cause harm to users and the blockchain. It isn’t easy to measure, but there is evidence of it occurring along with the blockchain. While it is difficult to prevent altogether, there are ways to mitigate loss, such as flashbots.

--

--