Back to the collection
Experiment / Data & forecasting working

Chain Fee Forecast

Turn partial-day blockchain activity into an inspectable end-of-day gas-fee estimate.

Capture-only transcript rendering of the Robinhood Chain offline end-of-day forecast command.

01 — The brief

Start with the useful tension.

The problem

Recent-chain intraday activity can be noisy when viewed in isolation. This engine combines sampled current activity, historical fee baselines, a UTC time-of-day profile, and Base-chain pace to produce an inspectable end-of-day fee estimate.

The audience

Operators and analysts monitoring Robinhood Chain fee activity who need an intraday EOD estimate with visible data coverage, components, and assumptions.

My contribution

Independently built the Python CLI, SQLite-backed ingestion and persistence, public-data fetchers, sampled chain activity pipeline, diurnal feature engineering, model training, and EOD forecast inference.

02 — Capability ledger

What exists, what is next.

A plain-language status check, so a polished surface never implies more than the work supports.

Implemented

07
  • Public daily fee history ingestion

    Fetches DefiLlama daily fee charts for Robinhood Chain and Base, converts timestamps to UTC dates, and stores source-labeled daily records in SQLite.

  • Sampled hourly chain activity estimates

    Locates hourly block windows and extrapolates gas used, base-fee-weighted fee estimates, transaction counts, and ETH/USD values from batched samples on Robinhood Chain and Base.

  • SQLite provenance and operational history

    Persists daily fees, hourly estimates, diurnal profiles, and prediction logs with source, sampling, timestamp, and estimate fields for later inspection.

  • Empirical Robinhood/Base diurnal blending

    Normalizes complete 24-hour activity days, uses a median profile when at least three full days are available (mean otherwise), falls back to a canonical prior when needed, and blends Robinhood and Base profiles into a cumulative UTC curve.

  • Feature vector and bounded EOD ensemble

    Builds a 14-value feature vector from accrued fees, cutoff hour, diurnal completion, run-rate, trailing baselines, day-of-week encoding, and Base pace, then blends Ridge inference with a diurnal run-rate projection while enforcing a prediction no lower than fees accrued.

  • Code-generated uncertainty bands

    Reports a labeled 90% interval using hourly residual-scale estimates that shrink with remaining diurnal completion; this is an implementation heuristic, not a demonstrated accuracy or coverage result.

  • CLI workflow surface

    Exposes predict, sync, backfill, train, diurnal, and status commands for inspecting data, updating derived profiles, and producing EOD forecast output.

Planned

00

Nothing recorded here yet.

Unverified

02
  • Net sequencer revenue accounting

    The README frames the project around fee revenue net of L1/blob costs, but the inspected implementation calculates sampled gas-fee estimates and leaves revenue_usd nullable; a demonstrated net-revenue calculation was not found.

  • Current live-data freshness

    The source includes an auto-sync path for current RPC and DefiLlama data, but this extraction intentionally exercised only an offline cached replay; endpoint availability and current-data freshness remain unverified.

03 — Design decisions

The reasoning stays in the room.

01Blend chain-specific activity with a Base prior

The source treats Robinhood Chain as young and uses the deeper Base-chain intraday shape to regularize the Robinhood profile rather than relying on one noisy chain in isolation.

02Normalize complete days before aggregating hourly shape

Per-day normalization removes day-to-day magnitude bias and lets the diurnal profile represent shape; a median is used when enough complete days exist to reduce the influence of single-hour spikes.

03Estimate hourly activity from sparse, rate-limited block samples

Timestamp interpolation plus chunked, throttled JSON-RPC sampling provides hourly estimates without fetching every block in the window.

04Use a bounded ensemble for intraday inference

The predictor shifts weight toward observed diurnal run-rate as the day progresses, moderates remaining pace using Base activity, and never returns an EOD estimate below fees already accrued.

05Use recency-weighted positive Ridge regression

The training code applies an approximately 21-day recency half-life, a positive-coefficient Ridge model, and alpha=20.0 to reduce obsolete-regime influence and overfitting risk.

06Keep source labels and estimate fields in the data model

The schema preserves whether daily data came from DefiLlama or a completed hourly sync and distinguishes estimated gas, fee, transaction, price, and sampling values for inspection.

05 — A short walk-through

See the shape of the interaction.

Capture storyboard

CLI coverage to offline EOD forecast

0:30
Storyboard · recording not supplied
  1. 0-5s — Start in an isolated copy of the repository with live integrations disabled and run cli.py status; frame the record counts and date ranges so the cache boundary is visible.
  2. 5-14s — Run cli.py diurnal in the same isolated copy; scroll or hold on the 24-hour UTC table to show Base, Robinhood, blended, and cumulative shares.
  3. 14-27s — Run cli.py predict --no-sync --date 2026-09-10 using the cached sampled aggregates; hold on accrued fees, the EOD estimate, 90% band, trailing baseline, and Base pace component.
  4. 27-30s — Stop on the forecast output and show a caption that the values are offline fee estimates from cached public aggregates, not live net sequencer revenue or an accuracy result.

The materials

Built with care.

Stack
  • Python
  • SQLite
  • NumPy
  • scikit-learn
  • joblib
  • requests
  • tabulate
  • JSON-RPC