Extraction of Ethereum transaction arrival and inclusion times allowing for limited MEV type classification.
This project was created to provide supporting data for my Plain Alex content layer solution and my presentation at the EthGlobal / HackMoney / MEV.wtf summit.
It allows for the collection of tx metadata such as arrival time in the mempool and subsequent inclusion time in the Ethereum blockchain.
In doing so, it allows for the broad categorization of Flashbots MEVA bundles into the MEV types: frontrunning, backrunning, sandwiching and other.
MEV type categorization can be performed by examining the relative position of dark txs (those added at block creation by the miner) and lit txs (those that arrive through the mempool) in individual MEVA bundles.
MEV type | Identifying features |
---|---|
sandwich attack | dark first and last txs, lit middle txs |
frontrun attack | dark first tx, lit final txs |
backrun attack | lit first txs, dark final tx |
other | none of the above, including single tx bundles |
Because categorization relies on arrival/inclusion time metadata and not the deep parsing of tx contents, some bundles may be misclassified.
Informal spot checks suggest it does a pretty good job, but the technique would benefit from greater auditing.
- Build the MySql tx_time database using the MySql/create_db_tx_time scripts.
- Set appsettings.json MySqlConnection to point to this db
- Set appsettings.json WssNodePath to point to an Ethereum Node web socket (eg: Infura)
- Compile and run the EthInclude.csproj Console app
- Enter the number of pending txs in the system (typically around 150000. For accurate arrival times, ignore these early txs when reporting)
- Collect data for as long as you want (note: disconnections are not gracefully handled at the moment)
- Run MySql/reports/update_bundles_nblock.sql against the db to update reporting fields
- Run sql reports against it (see MySql/reports for examples)
- .Net Core and IDE (Visual Studio 2019 / Visual Studio Code)
- MySql
- Ethereum node (eg: Infura)
- Flashbots API
This is the sample data set used in MEV type categorization in my talk.
P mcgoohan
Find me on Twitter, Medium, Github, Eth.Research, Reddit (predicting MEV in 2014)
This project is licensed under the MIT License - see the LICENSE.md file for details