The crypto markets are very dynamic. Traders from TradFi might actually get lost in all the Defi jargon, especially because there is technology involved. Many of you have read a bunch of articles talking about MEVs (Maximal Extractable Value), block-building, Ethereum relays, and Flashbots, but did you understand any of that stuff?
In this article, we shall explain these concepts using the chain of events of a single transaction.
Swap those Tokens!
By now a majority of users understand how a typical Ethereum transaction takes place. Ethereum transactions can range from minting NFTs, token approvals, swaps, bidding, staking, and yield farming, among many others. Let us explore swapping.
On Uniswap, you can easily swap tokens, for instance selling some ETH to get USDC in return:
This transaction would typically involve you connecting your wallet to Uniswap, and then making a swap.
Chain of Events
- What happens next (behind the scenes) is that your TX moves to the Ethereum network. This occurs via an RPC (usually Infura). To understand what Infura is, think of a waiter in a hotel who takes your ‘order’ and submits it to the kitchen (Ethereum network).
- Once the TX reaches the network, it is included in a mempool (a pool of transactions from other users of the network).
When the pool is ‘full’, the transactions are included in one block. The transactions order in the block is based fee amount paid unless there is an MEV around.
Hold Up! How is MEV Created?
To understand this, assume you have 10k ETH on the blockchain. AMMs,like Uniswap, usually experience small (or sometimes large) slips on every transaction on every dollar of asset sold.
Therefore, if you attempt to sell a large amount of a single assets, like 10,000 ETH for instance, the new price will be lower than that of the current market.
MEV Searchers and Bots
MEV searchers scan for such opportunities and once identified, they would buy ETH at the new price in that AMM, and sell it back at the current market price, bagging the difference as profit. In some cases, the MEV extractors can front-run you, buy up an asset and sell it to you at a mark-up price.
In order for the MEV searcher to back-run you and sell you at a profit, they have to pay the highest fee/tip of all transactions in a given block, allowing their TX to be included first.
Enter Flashbots
Flashbots aware created to deal with the MEV problem. The TL;DR of flashbots is that its a giant auction. It allows MEV extractors to bid on the blockspace, instead of using brute force to kick smaller traders out of the queue.
With flashbots, if you (as an MEV searcher) wants the TX that’s immediately after mine, you can bid for it. If you win you get to front-run the TX. A successful bid involves the different MEW extractors submitting their bundles of TXs at the same time to the block builder.
The block builder then includes it in a block which is passed on to a service called relay. The relay then ‘escrows’ the block and shows the bids in the block to the validators (or would-be miners in the previous Ethereum PoW).
There are many relays which operate simultaneously, competing against each other to present the most valuable block to the network validators.
Conclusion
This is perhaps the simplest way to explain these complex concepts in under a thousand words. Further reading would do you well and will help you understand the concepts intimately. MEVs present lucrative risk-free arbitrage opportunities.