The Era of MEV
Plus Uniswap v3 finds quick success and what are "sandwich transactions"?
Miner Extractable Value or MEV has slowly crept into every crevice in DeFi, quickly moving from academic concept to the undercurrent for all Ethereum transactions.
Its growth is hard to measure, but by all accounts, MEV has skyrocketed from basically nothing a year ago.
This increase is not due (only) to ETH price appreciation but because of increased arbitrage opportunities and a growing awareness from miners on how to exploit it.
Paradigm’s Charlie Noyes explains:
The concept of MEV was first introduced by Phil Daian in “Flash Boys 2.0,” and more recently popularized by my colleagues Dan Robinson, Georgios Konstantopoulos, and samczsun in “Ethereum is a Dark Forest” and “Escaping the Dark Forest.”
MEV is a measure of the profit a miner (or validator, sequencer, etc.) can make through their ability to arbitrarily include, exclude, or re-order transactions within the blocks they produce.
Imagine there’s a $10,000 arbitrage opportunity available on Uniswap after a large trade has caused price slippage. An arbitrage bot notices the opportunity and submits a transaction to capture it, offering a $10 txfee to the miner. One of two things may happen:
A miner will copy and censor the arbitrageur’s transaction in order to capture the opportunity themselves.
Other bots will notice and bid a higher txfee, starting a bidding war for the right to capture the arbitrage. The auction is called a “Priority Gas Auction” (PGA).
The $10,000 potential profit is MEV. If a miner does not capture it, and a PGA is kicked off, the difference between the price at which the auction settles and the total MEV available is the winning trader’s profit (e.g., if a $7,000 fee is paid to a miner, the remaining $3,000 is left to the trader).
MEV is Rent
In the race to quantify MEV and explore the Dark Forest, we never fully grasped its implications. To take a step back, public blockchains are different than databases because they are permissionless; anyone can submit a transaction on the network without fear of their transactions being censored.
Reordering transactions is not overt censorship, but it does disrupt the credible neutrality of miners. They are no longer acting in accordance with the economic incentives of the blockchain through block rewards and transaction fees, instead their activity is motivated by profit-seeking opportunities within the transactions on the network.
This essentially means miners are rent-seeking third parties that extract fees from network participants by leveraging their ability to reorder transactions.
MEV is the largest threat to the decentralization of Ethereum, because it creates gatekeepers or a system of gatekeepers whose incentives are driven by off-chain dynamics.
Flashbots…so hot right now
Phil Daian and the Paradigm guys simply explored the Dark Forest, Flashbots, which Daian is a member of, are trying to turn the flood lights on and extricate MEV from the normal Ethereum fee market.
From Ethereum Magicians:
Flashbots implements a transaction censorship specification (so we can speak more concretely) that gives them a monopoly* on, on-chain arbitrage.
(1) Adds a networking layer that functions as a private/privileged transaction pool for miners to whisper MEV bundles (arb opportunities): mev-geth/api.go at c3303c3db5a60b12d8a324194e0337fa16e98368 · flashbots/mev-geth · GitHub 3
(2) Ignores canonical txpool unless there is zero profit margin: mev-geth/worker.go at c3303c3db5a60b12d8a324194e0337fa16e98368 · flashbots/mev-geth · GitHub
Flashbots’ MEV-GETH allows Ethereum miners to function normally but also automates the arbitrage transaction and payment for reordering those. It is now being used by most of the top mining pools with a significant overall market share.
Finding Consensus on what?
Flashbots is an open research initiative and has committed to publishing transparency reports about their inner workings, but its rapid rise does raise questions about the power it will have over Ethereum. Will all Ethereum transactions go through Flashbots and pay a small tribute to the MEV gods? How are the arbitrage transactions auctioned off?
This highlights two core problems for blockchains (particularly Ethereum):
Transactions contain different amounts of real world economic value and thus are willing to pay for different security guarantees. Paying a single transaction fee, regardless of the monetary value in the transaction, means that smaller transactions overpay and larger transactions underpay for security.
A public mempool where transactions must be submitted and are publicly viewable before they are actually included in a block. In this design, there will always be a public waiting period where arbitragers can monitor and front-run transactions.
These are very hard problems get at the core of what public blockchains are trying to accomplish. Flashbots is addressing the network clog that arbitragers have inflicted on Ethereum, but a solution must come at the protocol level or have the security and decentralization assurances of a blockchain.
Layer 2 migration expands MEV
EIP-1559 and Layer 2 launches are the major developments in the Ethereum gas market at the moment, not to mention ETH2.0 launch sometime later this [insert date here]. EIP-1559 implementation will help slightly with MEV, but does not change the underlying dynamics, while ETH2.0 offers scalability without any MEV relief.
Layer 2 solutions do have to be explicit with their approach to minimize MEV. L2 solutions like ZK or Optimistic rollups batch transactions and submit a proof to the main chain of all of the transactions, which means most transaction ordering will switch to Layer 2. The security of the transaction for Layer 2’s is secured by Ethereum, but the order of the transaction will be determined by the Layer 2 nodes.
Just like on Layer 1, the transaction order for blocks on most Layer 2’s is determined by the block producer that scans the mempool for transactions to include.
Optimism proposes a “MEV Auction” for transaction ordering. In this model, block producers simply propose a set of transactions to eventually be included before N blocks. And then there is an auction for a “sequencer” to reorder the transactions and add their own, theoretically tying MEV extraction to the L2 protocol incentives.
Ed Felten, founder of Arbitrum, another Optimistic Rollup and an Optimism competitor, argues that MEV auctions are bad design because they impose an extra cost on users. Arbitrum instead is opting for a “Fair sequencing” design based on an academic paper released last August (one of Arbitrum’s co founders was a co-author).
MEV all the way down
MEV is all encompassing. Even with all of recent hoopla, I think the market is still underestimating how much energy (and arguing) will be spent trying to limit MEV in the coming years. It will affect how dapps are built and how Ethereum scales, while posing the big question of what is the value of decentralization?
A lot of discussion and ideating still being done. If you have a couple hours, check out the latest MEV Roast, which took place last Thursday at the Scaling Ethereum conference. It has presentations and discussion from Vitalik, Phil Daian and loads of others. Some other good resources (on top of the ones from last month):
ETH 2.0, MEV/VEV, Staking, and the Looming Specter of EV Farming Pools [@IsdrsP]
Rapid Rise of Ethereum MEV [Etherscan Blog]
MEV Auctions Will Kill Ethereum [pmcgoohan]
Diving into Arbitrum’s Optimistic Rollup [Zero Knowledge Podcast]
Tweet of the Week: MEV Sandwiches
Okay, not the most informative tweet, but one that generated a lot of MEV-related replies. Nick Johnson, the Lead Developer for ENS, is trying to avoid getting “sandwiched”, which means an arb bot puts transactions before and after yours to extract all of the slippage you set. Most replies to the Tweet said “0x limit orders” or “set your price and wait for an arbitrager to pick it up” but Nick is specifically asking about multi-sig wallets, which rely on multiple signatures that may take time to coordinate. Two solutions popped up in the replies, CowSwap, from Gnosis and Balancer, and ArcherSwap, but both are not applicable to smart contract wallets (yet).
Chart of the Week: Uniswap v3 and v2 volume
It’s been just 5 days since Uniswap v3 launched and its already done $2.2bn in volume. V3 is currently 30% of Uniswap’s total volume, according to the chart above from one of two helpful Dune dashboards on Uniswap v3. The top pairs on v3 don’t look that different from v2. ETH-stablecoin pairs are 43% of overall volume, while stablecoin-stablecoin pairs are 12% of overall volume.And then, of course, SHIB-ETH has accounted for 16% of Uniswap’s v3 volume 🙄 .
Uniswap v3 has definitely passed the capital efficiency test, particularly because they’ve been able to build up liquidity in highly traded pairs where most liquidity is subsidized. The questions are 1. Can they still attract the long-tail of assets 2. What integrations/products will be built to make LPing more fungible.
Odds and Ends
Maker Foundation returns 84k MKR to the MakerDAO Link
AlphaFinance April Summary and Q2 outlook Link
Rari: the path forward after May 8’s exploit Link
Gauntlet partnering with Sushiswap to optimize SUSHI emissions Link
Bankless DAO launches Link
dYdX has done more than $800m in volume since Layer 2 launch last month Link
Thoughts and Prognostications
Ethereum’s institutional adoption [Nate Maddrey/Coin Metrics]
Protocols and Creator DAOs: Economic Flows and Cultural Products [Jarrod Dicker]
Legitimacy [Vitalik Buterin/Bankless Podcast]
Q1 2021 DeFi Report [Consensys]
Uniswap and the rise of DeFi [Hayden Adams/Odd Lots Podcast]
DeFiRanger: Detecting Price Manipulation Attacks on DeFi Applications [Lots of academics]
That’s it! Feedback appreciated. Just hit reply. Written in Brooklyn. Sorry for last week’s absence. Taxes :-/
Dose of DeFi is written by Chris Powers. Opinions expressed are my own. I spend most of my time contributing to DXdao*. All content is for informational purposes and is not intended as investment advice.