Skip to main content

mev-boost python wrapper to access mev-boost data

Project description

mev-boost-py

Python wrapper for querying mev-boost data. This tool provides easy access to Ethereum proposer payload data from Flashbots relays, allowing users to query both "holesky" and "mainnet" networks. It supports fetching data for specific slot ranges or the most recent slots. This is most useful for streaming the most recent 200 mev-boost slots directly to a json file.

Features

  • Fetch proposer payloads from Flashbots relays
  • Supports both "holesky" and "mainnet" networks
  • Specify slot ranges or fetch the most recent data
  • Save data to JSON files for flexible analysis

Installation

To install mev-boost-py, use pip pip install mev-boost-py

Usage Instructions:

Run from CLI:

python src/mev_boost_py/proposer_payload.py --network mainnet --start_slot 2447969 --end_slot 2448969 --directory output_folder This command will fetch proposer payloads from the "mainnet" network for the specified slot range and save them in the "output_folder". If output_folder is not specified, it will default to "data" folder.

Run from Python Code:

from mev_boost_py.proposer_payload import ProposerPayloadFetcher, Network

# Create an instance with the desired configuration
fetcher = ProposerPayloadFetcher(
    network=Network.HOLESKY,
    start_slot=2447969,
    end_slot=2448969,
    directory="output_folder"
)

# Execute the fetch operation
fetcher.run()

Example Json File:

  {
    "slot": 2447969,
    "parent_hash": "0x...",
    "block_hash": "0x...",
    "builder_pubkey": "0x...",
    "proposer_pubkey": "0x...",
    "proposer_fee_recipient": "0x...",
    "gas_limit": 30000000,
    "gas_used": 21000,
    "value": 1000000000000000000,
    "num_tx": 1,
    "block_number": 12345678
  },
  ...
]

Example DataFrame Output:

Schema: Schema({'slot': String, 'parent_hash': String, 'block_hash': String, 'builder_pubkey': String, 'proposer_pubkey': String, 'proposer_fee_recipient': String, 'gas_limit': String, 'gas_used': String, 'value': String, 'num_tx': String, 'block_number': String})

Data:

│ slot    ┆ parent_hash                     ┆ block_hash                      ┆ builder_pubkey                  ┆ … ┆ gas_used ┆ value             ┆ num_tx ┆ block_number │
│ ---     ┆ ---                             ┆ ---                             ┆ ---                             ┆   ┆ ---      ┆ ---               ┆ ---    ┆ ---          │
│ str     ┆ str                             ┆ str                             ┆ str                             ┆   ┆ str      ┆ str               ┆ str    ┆ str          │
╞═════════╪═════════════════════════════════╪═════════════════════════════════╪═════════════════════════════════╪═══╪══════════╪═══════════════════╪════════╪══════════════╡
│ 2451003 ┆ 0x3739ec860534152c1c16c0fe375e… ┆ 0xc52774ef565609df07506bc4693c… ┆ 0xa3ad1da9373ae97c21274629668d… ┆ … ┆ 5874398  ┆ 9193837799832420  ┆ 39     ┆ 2258300      │
│ 2450989 ┆ 0xf7cab7c264373654e233db6a6124… ┆ 0x17b6a32b12b617b97867c6da88e1… ┆ 0x8cafae64383b537561650b2e3893… ┆ … ┆ 3558221  ┆ 9013912242542186  ┆ 19     ┆ 2258287      │
│ 2450982 ┆ 0x326c13991cf5b4ac6708be98ff15… ┆ 0x274271bb3c0b60c9fd99b05e51ae… ┆ 0x9400cb1e7c0fa7120ea0e4a7fcce… ┆ … ┆ 5751748  ┆ 18445048399967342 ┆ 35     ┆ 2258281      │
│ 2450974 ┆ 0xb0587362a27183e4a0e67a76fd81… ┆ 0x3e5776f98ccd447f478b150b7c7e… ┆ 0xa3ad1da9373ae97c21274629668d… ┆ … ┆ 4211778  ┆ 6062918999738481  ┆ 29     ┆ 2258274      │
│ 2450966 ┆ 0x24148e3b1ae003c5cb981653fd62… ┆ 0x7a8e508c671808cf25c835a67632… ┆ 0x9400cb1e7c0fa7120ea0e4a7fcce… ┆ … ┆ 4765098  ┆ 16225500999853000 ┆ 32     ┆ 2258267      │
│ …       ┆ …                               ┆ …                               ┆ …                               ┆ … ┆ …        ┆ …                 ┆ …      ┆ …            │
│ 2449791 ┆ 0x99a3d7228237038aff3b0f7cd55d… ┆ 0xfc224a4d9c0b84b35f6a55274124… ┆ 0x8cafae64383b537561650b2e3893… ┆ … ┆ 5308725  ┆ 18187345999853000 ┆ 31     ┆ 2257186      │
│ 2449787 ┆ 0x34d567e910b719e2a8fe0796b85a… ┆ 0x132fedf886b25e9018ee50f1ba58… ┆ 0x8cafae64383b537561650b2e3893… ┆ … ┆ 4510283  ┆ 17028919999853000 ┆ 29     ┆ 2257182      │
│ 2449776 ┆ 0x0606e5fdb340780a5a0e53ad7a6f… ┆ 0x387f87adfdc8e9f027c9b89d5c05… ┆ 0x9400cb1e7c0fa7120ea0e4a7fcce… ┆ … ┆ 7415437  ┆ 15136000097096026 ┆ 47     ┆ 2257171      │
│ 2449763 ┆ 0x6a5fec654d5c46905031a1e49455… ┆ 0x3fe0bc5893a0e7950426fbd018aa… ┆ 0x9400cb1e7c0fa7120ea0e4a7fcce… ┆ … ┆ 1347531  ┆ 12233676999853000 ┆ 10     ┆ 2257160      │
│ 2449762 ┆ 0x33ee162a56062162d337e71be7a5… ┆ 0x6a5fec654d5c46905031a1e49455… ┆ 0x9400cb1e7c0fa7120ea0e4a7fcce… ┆ … ┆ 4844588  ┆ 17795490999853000 ┆ 27     ┆ 2257159      │
└─────────┴─────────────────────────────────┴─────────────────────────────────┴─────────────────────────────────┴───┴──────────┴───────────────────┴────────┴──────────────┘

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mev_boost_py-0.1.1.tar.gz (50.5 kB view details)

Uploaded Source

Built Distribution

mev_boost_py-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file mev_boost_py-0.1.1.tar.gz.

File metadata

  • Download URL: mev_boost_py-0.1.1.tar.gz
  • Upload date:
  • Size: 50.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for mev_boost_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 94811c33e26c7f1dc77bafbb323a3bee161b2fe75217a6bdf9c63668ddb449a3
MD5 8140e5e687712adac32b27cc50850550
BLAKE2b-256 1b0929aaa0ca3be96a58872c90a792ac01ae231f899c5629fade1aa665b6962f

See more details on using hashes here.

File details

Details for the file mev_boost_py-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mev_boost_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa1ec362a3928cb4c48ac98f6bfa677fa19e81bfd59b00004b825a8fef1531eb
MD5 b3749748941927403694646ac39c9ee6
BLAKE2b-256 241e85ed4897ff68a6d009f535d54d929384edf4d9a10debaa48de3a925eaa6e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page