dineshpinto / mev-bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MEV

"Ethereum is a dark forest" - Dan Robinson

What is MEV?

MEV is the quantitative value that can be extracted (primarily) from tx re-ordering, inclusion and optimization in a block before it gets added to the blockchain. The "dark forest" refers to the mempool, a place where transactions sit before being picked up by miners to be added into a block. The term itself is maximal extractable value, or sometimes (rather confusingly) miner extractable value.

Is it growing?

Based on various quantitative metrics, such as presented on the Flashbots site, the total extracted MEV currently exceeds $600M, with around $20M extracted in the last 30 days alone. A majority of this (over 99%) comes from arbitrage, and over 97% coming from just three ETH protocols (uniswap v2, uniswap v3 and balancer v1). Further, looking at the growth in MEV over time and complexity of solving the issue (solutions include random tx ordering etc.), it's clear that MEV is here to stay.

Is it only on PoW ETH?

No. Effectively, any party capable of validating transactions on a PoW/PoS chain is can extract MEV (e.g. validators on PoS ETH, rollup providers on Optimism etc.).

Important references

Theory

OG work

Paradigm Research

Basics

GitHub repos and Twitter threads

Why are we here?

We will focus primarily on atomic arbitrage, basically creating a series of on-chain interactions that sequentially execute and check if some conditions are met. If the conditions are not met, the entire transaction set is reverted, kinda like an undo button.

The atomic arbitrage space is incredibly competitive, and the probability of making a profitable trade on the larger DeFi protocols is practically 0. However, the goal here is to understand how MEV works, implement some basic strats, and eventually apply that to long-tail MEV strats that have a higher EV. For an example of a long tail strat see this Chainsight Twitter thread.

Disclaimer

This project is for educational purposes only. You should not construe any such information or other material as legal, tax, investment, financial, or other advice. Nothing contained here constitutes a solicitation, recommendation, endorsement, or offer by me or any third party service provider to buy or sell any securities or other financial instruments in this or in any other jurisdiction in which such solicitation or offer would be unlawful under the securities laws of such jurisdiction.

If you plan to use real money, use at your own risk.

Under no circumstances will I be held responsible or liable in any way for any claims, damages, losses, expenses, costs, or liabilities whatsoever, including, without limitation, any direct or indirect damages for loss of profits.

About

License:Apache License 2.0