Maximal extractable value inspector for Ethereum, to illuminate the dark forest 🌲 💡

Overview

mev-inspect-py

standard-readme compliant Discord

Maximal extractable value inspector for Ethereum, to illuminate the dark forest 🌲 💡

Given a block, mev-inspect finds:

  • miner payments (gas + coinbase)
  • tokens transfers and profit
  • swaps and arbitrages
  • ...and more

Data is stored in Postgres for analysis.

Install

mev-inspect-py is built to run on kubernetes locally and in production.

Dependencies

Set up

Create a new cluster with:

kind create cluster

Set an environment variable RPC_URL to an RPC for fetching blocks.

mev-inspect-py currently requires a node with support for Erigon traces and receipts (not geth yet 😔 ).

pokt.network's "Ethereum Mainnet Archival with trace calls" is a good hosted option.

Example:

export RPC_URL="http://111.111.111.111:8546"

Next, start all services with:

tilt up

Press "space" to see a browser of the services starting up.

On first startup, you'll need to apply database migrations with:

./mev exec alembic upgrade head

Usage

Inspect a single block

Inspecting block 12914944:

./mev inspect 12914944

Inspect many blocks

Inspecting blocks 12914944 to 12914954:

./mev inspect-many 12914944 12914954

Inspect all incoming blocks

Start a block listener with:

./mev listener start

By default, it will pick up wherever you left off. If running for the first time, listener starts at the latest block.

Tail logs for the listener with:

./mev listener tail

And stop the listener with:

./mev listener stop

Backfilling

For larger backfills, you can inspect many blocks in parallel using kubernetes

To inspect blocks 12914944 to 12915044 divided across 10 worker pods:

./mev backfill 12914944 12915044 10

You can see worker pods spin up then complete by watching the status of all pods

watch kubectl get pods

To watch the logs for a given pod, take its pod name using the above, then run:

kubectl logs -f pod/mev-inspect-backfill-abcdefg

(where mev-inspect-backfill-abcdefg is your actual pod name)

Exploring

All inspect output data is stored in Postgres.

To connect to the local Postgres database for querying, launch a client container with:

./mev db

When you see the prompt:

mev_inspect=#

You're ready to query!

Try finding the total number of swaps decoded with UniswapV3Pool:

SELECT COUNT(*) FROM swaps WHERE abi_name='UniswapV3Pool';

or top 10 arbs by gross profit that took profit in WETH:

SELECT *
FROM arbitrages
WHERE profit_token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
ORDER BY profit_amount DESC
LIMIT 10;

Postgres tip: Enter \x to enter "Explanded display" mode which looks nicer for results with many columns.

FAQ

How do I delete / reset my local postgres data?

Stop the system if running:

tilt down

Delete it with:

kubectl delete pvc data-postgresql-postgresql-0

Start back up again:

tilt up

And rerun migrations to create the tables again:

./mev exec alembic upgrade head

I was using the docker-compose setup and want to switch to kube, now what?

Re-add the old docker-compose.yml file to your mev-inspect-py directory.

A copy can be found here

Tear down docker-compose resources:

docker compose down

Then go through the steps in the current README for kube setup.

Error from server (AlreadyExists): pods "postgres-client" already exists

This means the postgres client container didn't shut down correctly.

Delete this one with:

kubectl delete pod/postgres-client

Then start it back up again.

Maintainers

Contributing

Flashbots is a research and development collective working on mitigating the negative externalities of decentralized economies. We contribute with the larger free software community to illuminate the dark forest.

You are welcome here <3.

  • If you want to join us, come and say hi in our Discord chat.
  • If you have a question, feedback or a bug report for this project, please open a new Issue.
  • If you would like to contribute with code, check the CONTRIBUTING file.
  • We just ask you to be nice.

Security

If you find a security vulnerability on this project or any other initiative related to Flashbots, please let us know sending an email to [email protected].


Made with ☀️ by the 🤖 collective.

Owner
Flashbots
Flashbots
Get the length of the Instagram encrypted password

instagram-weak-encryption Get the length of the Instagram encrypted password Introduction Instagram and Facebook encrypt the password submitted at log

Giuseppe Criscione 19 Dec 09, 2022
A simple Ethereum mining pool

A simple getWork pool for ethereum mining

93 Oct 05, 2022
Token drop template on Tezos blockchain, based on Merkle Tree Distribution mechanism.

🛬 Token Drop Template This is a template to perform token drops efficiently on Tezos blockchain. The drop is handled using Merkle Tree Distribution m

Anshu Jalan 5 Oct 11, 2022
TON Command Line Interface - easy smart contract manipulation

toncli The Open Network cross-platform smart contract command line interface. Easy to deploy and interact with TON smart contracts. Installation Toncl

Disintar IO 100 Dec 18, 2022
That Hash will name that hash type! Identify MD5, SHA256 and 300+ other hashes Comes with

Call for translators! We're looking for translators to help translate this spec for everyone! Read this documentation in the following languages 한국어 中

All Contributors 6.8k Jan 05, 2023
Lottery by Ethereum Blockchain

Lottery by Ethereum Blockchain Set your web3 provider url in .env PROVIDER=https://mainnet.infura.io/v3/YOUR-INFURA-TOKEN Create your source file .

John Torres 3 Dec 23, 2021
This project is a proof of concept to create a dashboard using Dash to display information about various cryptocurrencies.

This project is a WIP as a way to display useful information about cryptocurrencies. It's currently being actively developed as a proof of concept, and a way to visualize more useful data about vario

7 Apr 21, 2022
Skepticoin is a peer-to-peer digital currency that enables you to send money online

What is Skepticoin? Skepticoin is a peer-to-peer digital currency that enables you to send money online. It's also the central community of people who

64 Aug 06, 2022
基于python的一款 加解密工具

基于python的一款 加解密工具 加密: SHA序列: sha1 , sha2 , sha224 , sha256 , sha384 , sha512 , sha512-256 , sha3-224 , sha3-256 , sha3-384 , sha3-512 MD序列: md4 , md5

3 May 05, 2022
PyCrypter , A Tool To Encrypt/Decrypt Text/Code With Ease And Safe Using Password !

PyCrypter PyCrypter , A Tool To Encrypt/Decrypt Text/Code With Ease And Safe Using Password ! Requirements pyfiglet And colorama Usage First Clone The

1 Nov 12, 2021
dashboard to track crypto prices and change via the coinmarketcap APIs

crypto-dashboard Dashboard to track crypto prices and change via the coinmarketcap APIs. Uses chart.js and ag-grid. Requirements: python 3 (was writte

4 Nov 09, 2021
Bit is Python's fastest Bitcoin library and was designed from the beginning to feel intuitive, be effortless to use, and have readable source code.

Bit is Python's fastest Bitcoin library and was designed from the beginning to feel intuitive, be effortless to use, and have readable source code.

Ofek Lev 1.1k Jan 02, 2023
High Performance Blockchain Deserializer

bitcoin_explorer is an efficient library for reading bitcoin-core binary blockchain file as a database (utilising multi-threading).

Congyu 2 Dec 28, 2021
Python program that handles the creation, encryption and storage of log/journal files. Kinda works like a diary of sorts.

LucaSoft J.O.U.R.N.A.L The J.O.U.R.N.A.L (Just anOther User Redaction & Navigation Assistant by Lucaspec72) is a Python program that handles the creat

Lucaspec72 8 Oct 27, 2021
Vaulty - Encrypt/Decrypt with ChaCha20-Poly1305

Vaulty Encrypt/Decrypt with ChaCha20-Poly1305 Vaulty is an extremely lightweight encryption/decryption tool which uses ChaCha20-Poly1305 to provide 25

Chris Mason 1 Jul 04, 2022
zhash is a simple Python tool which allows to create/crack hashes

zhash zhash is a simple python tool which allows you to crack/create hashes. Below are the list of supported algorithms that zhash can crack Supported

3 May 27, 2022
Highly decentralized and censorship-resistant way to store key data

Beacon coin Beacon coin is a Chia singelton coin that can store data that needs to be: always available censorship resistant versioned potentially imm

Sebastjan Trepca 24 Oct 04, 2022
Gearbox-vyper-contracts - Auxillary contracts for the Gearbox Protocol written in Vyper

Gearbox Vyper Contracts Auxillary contracts for the Gearbox Protocol written in

Edward Amor 4 Jan 07, 2022
Tron Wallet (TRX) Crack Finder With Python Just 64 Line

TRXGEN Tron Wallet Finder and Crack With Python Tron Wallet (TRX) Crack Finder With Python Just 64 Line My tools [pycharm + anaconda3 + python3.8 + vi

MMDRZA 6 Dec 18, 2022
Fully configurable automated python script to collect most visted pages based on google dork

Ranked pages collector Fully configurable automated python script to collect most visted pages based on google dork Usage This project is still under

Security Analyzer 9 Sep 10, 2022