Watcher

The Watcher provides real-time mempool intelligence: fee estimates, mempool state snapshots, anomaly detection, and human-readable summaries.

Quick Start


import asyncio
from bitpilot import Watcher

watcher = Watcher.from_default_providers(network="mainnet")

fee = asyncio.run(watcher.estimate_fee(target_blocks=3))
print(fee.human_readable())

state = asyncio.run(watcher.get_mempool_state())
print(state.human_summary())

Factory Methods

MethodBackend
Watcher.from_default_providers(network)mempool.space public API
Watcher.from_node_rpc(url, network)Bitcoin Core JSON-RPC
Watcher.from_mock(network)Offline mock data for testing

Key Methods

Anomaly Detection

The watcher runs an AnomalyDetector on every mempool refresh, flagging:

Providers

Providers implement the MempoolProvider protocol:

Exceptions