Flashbots
Utilities for- 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
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