cryptoenthusiast0x2021 / flashbots

Flashbots utilities in Go: Blocks & Transactions API, and a tool to spot failed Flashbots and 0-gas transactions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Utilities for Flashbots

  • Go API client for the mev-blocks API for information about Flashbots blocks and transactions
  • Detect bundle errors: (a) out of order, (b) lower gas fee than lowest non-fb tx
  • Detect failed Flashbots and other 0-gas transactions (can run over history or in 'watch' mode, webserver that serves recent detections)
  • Various related utilities

Uses:

Notes:

  • There are a lot of API calls (one for each tx), it will only be fast if you are on (or close to) the geth node.
  • Ideas, feedback and contributions are welcome.

Reach out: twitter.com/metachris


Flashbots Blocks & Transactions API

https://blocks.flashbots.net/

Installation:

go get github.com/metachris/flashbots/api

Usage:

// Blocks API: default
block, err := api.GetBlocks(nil)

// Blocks API: options
opts := api.GetBlocksOptions{BlockNumber: 12527162}
block, err := api.GetBlocks(&opts)


// Transactions API: default
txs, err := GetTransactions(nil)

Getting Started

A good starting point is cmd/block-watch/main.go, which monitors blocks and bundles and reports issues:

  • Failed Flashbots (or other 0-gas) transaction
  • Bundle out of order by effective-gasprice
  • Bundle effective-gasprice is lower than lowest non-fb tx gasprice

About

Flashbots utilities in Go: Blocks & Transactions API, and a tool to spot failed Flashbots and 0-gas transactions.

License:MIT License


Languages

Language:Go 99.9%Language:Shell 0.1%