Skip to content

Ethereum transaction arrival and inclusion time data extraction and reporting and MEV type classification

License

Notifications You must be signed in to change notification settings

pmcgoohan/EthInclude

Repository files navigation

Eth Include

Extraction of Ethereum transaction arrival and inclusion times allowing for limited MEV type classification.

Description

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 Categorization Methodology

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

Limitations

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.

Getting Started

  • 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)

Dependencies

  • .Net Core and IDE (Visual Studio 2019 / Visual Studio Code)
  • MySql
  • Ethereum node (eg: Infura)
  • Flashbots API

Sample Data

This is the sample data set used in MEV type categorization in my talk.

Authors

P mcgoohan

Find me on Twitter, Medium, Github, Eth.Research, Reddit (predicting MEV in 2014)

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

About

Ethereum transaction arrival and inclusion time data extraction and reporting and MEV type classification

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages