What exactly is MEV?
MEV refers to the ability to extract some profit from the reorganization of transactions in a block. Yes, because there’s a time window where user’ submitted transactions have not yet been confirmed and can be reordered in such a way to gain some additional value.
That’s why MEV stands for: Maximum Extractable Value.
Example: consider two different scenarios for the same set of transactions SCENARIO 1 Starting $ATOM price: $20 - users txs: multiple BUY orders for a total of 1million $ATOM →$ATOM price = $25 - my tx: BUY order of 100 $ATOM→$ATOM price ≃ $25 - my tx: SELL order of 100 $ATOM →$ATOM price ≃ $25 my profit ≃ $0 ------------------------------------------------------------------------------------------------------------------- SCENARIO 2 Starting $ATOM price: $20 - my tx: BUY order of 100 $ATOM→$ATOM price ≃ $20 - users txs: multiple BUY orders for a total of 1million $ATOM →$ATOM price = $25 - my tx: SELL order of 100 $ATOM →$ATOM price ≃ $25 my profit = 100* $5 = $500
It is clear that the same transactions ordered in two different ways end up with a different profit for my pocket.
This is exactly what a MEV algorithm can do: it scans all the opportunities created by users analyzing all unconfirmed transactions living in the limbo of the mempool and orders their execution inside a block to extract some additional value.
Mempool: space where pending transactions are stored prior to being picked up by a miner/validator and added to the blockchain.
The bad MEV
MEV strategies are used by algorithmic traders since many years. Typically txs order is forced by front-running, meaning that once a profitable opportunity is detected, unwanted pending transactions are replaced by new ones willing to pay higher gas prices, so that validators will pick those among the others.
“Paying more fees my transaction will jump over the queue, so I can have priority over this slippage opportunity.”
Average MEV bad actor’s thoughts
This also means that the mempool will be filled with txs that won’t get confirmed, contributing to network congestion. Network congestion is very likely to happen in moments of crisis when market experience high volatility, and a multitude of actors battle for price spread opportunities (→ see Terra Network collapse data).
An interesting malicious type of front-running is the so called Sandwich-Attack, where the attacker, after detecting a large pending trade on a DEX, places a trade right before and after it to benefit from the price change.
The good MEV
To define what a good MEV is, we should be able to understand for what a tx-reorganization can be useful.
Where does the MEV profit go?
It is still being deeply discussed, but many think a good MEV should redistribute profits over the community: to stakers, to validators who validates the reorganized block, to holders (burning half of the profits would reduce token supply pushing up the price).
In this way, a good MEV could fight a form of centralization:
people with huge amounts of capital on different chains, can capture the more opportunities with respect to normal users;
almost all arbitrage opportunities are captured by selected few addresses that can afford the low-latency infrastructure required to win the MEV race.
Pros
An optimized MEV could lead to several pros for the community:
Increased rewards for stakers and validators.
Network congestion reduction when high volatilty occurs: 1 tx is placed instead of 100 txs.
Transaction fees reduction: this can be achieved through a batch of similar txs and automatic refund for replaced txs.
Redirect profits to promising projects in the Cosmos ecosystem.
Prevent chain halting risk: large waves of spam txs can knock out full nodes when many actors try to capture the MEV profit.
Cons
As every major innovation, also MEV has collected some critics:
Reduced node speed: applying such an algorithm to every block inevitably impacts the blocktime. Estimated delays are in the order of 5µsec - 25msec.
Not profitable over the long period: high slippage (5%) AMM-pools would realistically not exist in years from now.
MEV centralization: some argues a community-MEV could centralize decisions over profits’ destinations.