DEV Community

Aditya
Aditya

Posted on • Originally published at aditya26sg.substack.com on

What is MEV?

First lets start with understanding what is MEV? It is known as Maximal extractable value. It refers to the practice of rearranging and reordering transactions waiting to be added to the blockchain, for the minors or network validators to extract maximum value .

MEV is possible due to decentralized nature of blockchain. As the minors and validators can see every transaction and contract code that is going to be included in the network and in the order in which they are going to be included.

Unlike web2 systems the minors and validators have the freedom to reorder transactions as they want in a given block. The pending transactions are temporarily sent to the network mempool which is a publicly accessed waiting area.

Validators can pick transactions and order them to create a block that can be verified. Normally this ordering should done by giving priorities to specific things like gas fees, but due to transparency it can present a profitable opportunity to extract value like arbitrage, sandwich attacks, etc.

There are complex algorithms and bots that look for MEV opportunities for profit and pay high gas fee to incentivize the miners or validators to include their transactions in the target blocks in order to get additional value.

Lets go into an example. In traditional financial system, arbitrage is the taken advantage of different in an asset price across different trading venues. So similarly arbitrage-based MEV takes advantage of the price variations of tokens across various DEXs.

The searchers generate additional value by purchasing tokens at a lower price on one exchange and selling them on higher price at an another exchange. This can also happen on 2 separate liquidity poole on the same exchange.

Another scenario is liquidation, in DeFi it is a process that occurs when the value of a borrower’s collateral does not cover the value of their loan. Once a debt is liquidated any individual can purchase the original collateral at a discount and resell the asset at a higher price to make a profit. Here the searchers act as liquidators who scan the blockchain for unhealthy loan positions that need to be liquidated. They identify the local positions that are eligible for liquidation, acquire the borrowers collaterals at a discounter price and resell at a higher price to gain the extra value.

These are non-harmful types of MEV because liquidations are a regular occurrence in any financial systems.

Arbitrum has a different transaction ordering policy. It is called timeboost that enables chain owners to capture the MEV on their chain, reduce spam and preserve fast block times. It does this while protecting users from harmful types of MEV like sandwich attacks.

Previously the arbitrum chains ordered the incoming transactions in First Come, First Serve basis, it protected users from harmful MEV types like sandwich attacks.

The downside of this is the searchers are incentivized by investing in hardware resources. Timeboost retains the benefits of FCFS but addresses its limitations. It is a set of rules that the sequencer of an arbitrum chain is trusted to follow when ordering the transactions.

How does timeboost work? It uses 3 different components to work:

  • a special express lane which allows valid transactions to be sequenced as soon as the sequencer receives them

  • an offchain auction to determine the controller of the express lane for a given round

  • an auction contract deployed on the target chain to serve as the canonical source of truth for the auction results and handling of auction proceeds

The auction round by default is 60 seconds. The transactions not in express lane are subjected to 200 ms delay in their arrival before being sequenced. The sequencer implements a special endpoint known as timeboost_sendExpressLaneTransaction. The transactions submitted to it will be sequenced immediately by the sequencer and it will only accept valid transaction payload to this endpoint if they are signed correctly by the current rounds controller of the express lane.

The normally submitted transactions will be considered non-express and artificially get delayed by 200 ms. Then the transactions are eventually sequenced into a single, ordered stream of transactions for the sequencer to post to a data availability layer.

Timeboost is an optional feature on the arbitrum chain infrastructure, it is the decision of the chain owner to enable it as it brings a unique way to accrue value for its token and generate revenue for the chain.

Top comments (0)