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
Простой шифратор работающий по ключам.

deCryptor Что это такое? Простой шифратор работающий по ключам и без них. Как пользоваться? СМОТРЕТЬ ИЗОБРАЖЕНИЕ Разработчики Роман Слабицкий - написа

Romanin 2 May 31, 2022
Distributed, blockchain based hashtables middleware for deduplication of file uploads to the cloud

distributed-blockchain-based-secure-file-dedupe Searching is Distributed, Block and Access List for each upload is unique and it is stored in a single

Abhishek Tangod 1 Dec 02, 2021
Cryptocurrency application that displays instant cryptocurrency prices and reads prices with the Google Text-to-Speech library.

📈 Cryptocurrency Price App 💰 ◽ Cryptocurrency application that displays instant cryptocurrency prices and reads prices with the Google Text-to-Speec

Furkan Mert 2 Nov 08, 2021
⚡ Automatically decrypt encryptions without knowing the key or cipher, decode encodings, and crack hashes ⚡

⚡ Automatically decrypt encryptions without knowing the key or cipher, decode encodings, and crack hashes ⚡

11.2k Jan 09, 2023
Simple bitcoin ticker for the Pimorono Inky pHAT Red.

bitcoin-ticker Simple bitcoin ticker for the Pimorono Inky pHAT Red. Equipment Raspberry Pi Zero W v1.1 or Pi 2 model b v1.1 Pimorono Inky pHAT Red (S

2 Mar 15, 2022
Kyrie Eleison - The best and unique way to encrypt some data or a file safely

Encrypt your important data and files easily and safely with Kyrie Eleison.

Billy 39 Oct 27, 2022
Address Validator (Bitcoin & Monero)

The Bitcoin address is an identifier of 26-35 alphanumeric characters, beginning with the number 1, 3 or bc1. 0, O, I, l are removed to avoid visual a

0 Mar 29, 2022
G-Research-Crypto-Competition - Project for passing the ML exam. Dataset took from the competition on the kaggle

G-Research-Crypto-Competition Project for passing the ML exam. Dataset took from

5 Jan 09, 2022
A simple Ethereum mining pool

A simple getWork pool for ethereum mining

93 Oct 05, 2022
Hide secret texts inside an image, optionally encrypt them with a password using AES-256.

Hide secret texts/messages inside an image. You can optionally encrypt your texts with a password using AES-256 before encoding into the image.

Teja Swaroop 97 Dec 29, 2022
BTCRecover is an open source wallet password and seed recovery tool.

BTCRecover is an open source wallet password and seed recovery tool. For seed based recovery, this is primarily useful in situations where you have lost/forgotten parts of your mnemonic, or have made

2 Aug 18, 2022
A python script for AES Angecryption in Steganography

Angecryption is an encryption or an decryption result from a file to create an other file with the same / or not type.

ISIS 3 Jul 25, 2022
This is a basic encryption and decryption program made in python.

A basic encryption and decryption program to visualize how the process of protecting data works.

Junaid Chaudhry 5 Nov 15, 2021
C0mptCrypt - An object-oriented, minamalistic, simple encryption library in Python

C0mptCrypt allows you to encrypt strings of text. It can only be decrypted using C0mptCrypt and not by random online tools. You can use this for a variety of things from creating passwords, to encryp

c0mpt0 4 Aug 22, 2022
This is a simple application to generate HD wallet addresses for cryptocurrency coins.

HD-Wallet-Address This is a mini service to generate addresses in the master HD-Wallet. It will use py_crypto_hd_wallet package as a base. Prerequisit

Amin Abbasi 1 Dec 16, 2021
A web app to scan crypto markets based on candlestick pattern recognition from

Crypto_Scanner A web app to scan crypto markets based on candlestick pattern recognition from "Japanese Candlestick Charting Techniques: A Contemporar

Chris Qi 27 Jan 01, 2023
Get the SHA256 hash of any file with this Python Script

Hashfile-SHA256 A SHA256 hash verifying script, written in python. Report Bug Table of Contents About The Project Built With Getting Started Prerequis

Ethan Gallucci 1 Nov 01, 2021
Active github repos of all cryptocurrencies

This repo is to maintain the list of active repositories for all cryptocurrencies that https://codemask.org uses. The active list will be automaticall

CodeMask 5 May 20, 2022
Mina is a new cryptocurrency with a constant size blockchain, improving scaling while maintaining decentralization and security.

Mina Mina is the first cryptocurrency with a lightweight, constant-sized blockchain. This is the main source code repository for the Mina project. It

1.6k Jan 07, 2023
Stai Beta Of Staiking Chain - Food, Water And Electricity - Worldwide

Stai Beta Of Staiking Chain - Food, Water And Electricity - Worldwide

STATION-I 2 Feb 05, 2022