Skip to content

Live · v1.0

Grid Call

A LONG, SHORT or FLAT call for every GB half-hour—locked in a public ledger about eight minutes before delivery, then scored against Elexon's prices so anyone can verify the record.

Published: at 03:00 PM

TL;DR

  • The buyer: operators of batteries, gas engines and flexible load who can lean export or consumption within minutes—not traders betting on hour-ahead fiction.
  • The decision: about eight minutes before each GB half-hour, say LONG (export more / consume less), SHORT (the opposite) or FLAT (edge too small to act).
  • The hook: every call is published before delivery, stored with the exact model inputs, and scored against Elexon’s published prices after the half-hour ends. A hash chain makes later rewriting detectable; the page re-runs the public model so you can check the maths yourself.
  • On walk-forward out-of-sample data (May 2025–October 2026, 26,044 half-hours), following the model after a £2/MWh acting cost earned £101,441 per 1 MWh position versus £89,134 for the blunt rule “repeat the last direction.” Most of the money comes from a well-known persistence effect; the model’s value is selectivity—acting less often while keeping more profit.
  • Not an LLM. A hand-written gradient-boosted tree scores in under a millisecond inside a Worker. Training uses only values Elexon had already published at lock time—no forecast leakage.

The Problem Flexible Assets Actually Have

The GB system price—the imbalance settlement price—can diverge sharply from what the same MWh was worth in the traded market. For a battery, a gas peaker or an interruptible load, the operational question is not “what will price do tomorrow?” It is narrower and more urgent: for the half-hour that starts in eight minutes, should we lean long or short?

That decision is physical. Ramp rates, state of charge, efficiency and wear all matter. Grid Call deliberately answers only the directional piece: is the expected spread between system price and market index price large enough to justify acting? Your asset applies its own economics on top.

I built this in the same spirit as the decision plane argument: narrow calls, scored outcomes, honest probabilities—not a chatbot narrating the power market.

What Grid Call Does

Each GB settlement period runs 30 minutes. On a cron schedule (minutes 22, 25, 52 and 55 UTC), a Cloudflare Worker:

  1. Pulls the latest public forecasts and outturns from Elexon’s Insights API.
  2. Builds 36 numeric features with a minimum two-period lag so nothing from the future leaks in.
  3. Runs a small gradient-boosted regressor to predict the system-minus-index spread.
  4. Applies a £2/MWh threshold (tuned on pre-test data): above it, LONG; below its negative, SHORT; otherwise FLAT.
  5. Writes a ledger row to D1: direction, rounded inputs, model version, timestamp and a SHA-256 hash chained to the previous row.

Roughly fifty minutes after a period starts, Elexon publishes the system price. The Worker scores open calls, links to Elexon’s own API responses for that half-hour, and updates cumulative P&L on the public page.

The product promise is accountability: the call exists before the outcome, and anyone can audit the chain.

The Data (All Open, All Timestamped)

Everything comes from Elexon’s BMRS Insights API—no key, Elexon open licence. Inputs include:

SignalRole
System price & net imbalance volumeThe outcome and the system’s stress
Market index priceReference for “what the MWh was worth” in the market
Demand & wind forecasts (earliest endpoints)What was knowable before gate closure
Demand & wind outturnsWhat actually happened, lagged appropriately
Loss-of-load margin forecastsSystem tightness at 1–12 hours ahead

Training deliberately avoids latest forecast endpoints, which encode revisions made after the fact. Wind forecasts are hourly; the feature layer aligns them to half-hour indices. The full three-year download is on the order of 2,000 HTTP requests and reproduces locally with npm run fetch.

What We Learned Before Shipping

Several design choices only became obvious once we walked the data honestly. They belong on a project page, not in a footnote.

Hour-ahead calls had no edge. An earlier version locked direction before gate closure, when the newest settled spread was four half-hours old. On validation data it lost money or broke even in every setup. That product was dropped before the test window was touched. Predictability decays fast with lag: on pre-test data, the share of half-hours where spread keeps the same sign as the last known one falls from 75.6% at lag 1 to 54.0% at lag 6. Grid Call works because batteries can still act at lag ~2, minutes ahead of delivery—not an hour.

Persistence pays; the model buys selectivity. Repeating the last published system direction is a strong baseline—it captures the market’s tendency to stay long or short for a few periods. On the out-of-sample backtest the simple rule still earns £89,134 per 1 MWh after a £2/MWh acting cost. The model earns £101,441 by acting on 68% of half-hours instead of 87%, with slightly higher profit per acted MWh (£7.75 vs £5.93 before costs). That is roughly 14% more total profit after costs, not a magic wand.

Hit rate is not profit. An early variant was “right” 59% of the time and still lost badly, because SHORT calls landed on the wrong side of price spikes. A handful of extreme half-hours dominate P&L; reporting only accuracy would mislead operators.

One shared code path for train and serve. Features, rounding and inference live in src/shared/ and run identically in the offline pipeline and the Worker. When the public page recomputed backtest numbers in the browser, it caught a real bug: floating-point noise treated zero spreads as wins and inflated hit rate. Spreads are now rounded to the penny at the source; ledger rows store those rounded inputs so a call is exactly reproducible.

Backtest Method (Walk-Forward, Out of Sample)

Numbers below are from May 2025 through October 2026—26,044 half-hours—with settings chosen only on earlier data, then refit month by month. They are not the tiny live ledger that started in November 2026; quote the backtest until live history is long enough to mean something.

MetricGrid Call modelRepeat last direction
Half-hours acted17,644 (68%)22,656 (87%)
Profitable acted calls60.4%60.2%
Profit per acted MWh (before £2/MWh cost)£7.75£5.93
Total after £2/MWh acting cost (per 1 MWh position)£101,441£89,134

Reproduce: clone the repo, run npm run fetch, npm run select, npm run backtest; results land in public/backtest.json and on the live site’s chart.

Architecture

Elexon API  →  parsers (src/shared/elexon.ts)
           →  features (36 inputs, MIN_LAG = 2)
           →  GBT predict + threshold decision
Pipeline (Node):  fetch → select → backtest → train-final  →  model/model.json
Worker (cron):    lockCall → D1 ledger + hash chain → scoreCalls when prices land
Public site:      index.html + app.js, /api/calls, /api/model, /#verify

The model is a JSON file small enough to download from /api/model. Inference is hand-written TypeScript gradient boosting—~52k training rows fit in about a second locally and score in well under a millisecond at the edge. That is intentional: half-hourly numeric regimes are a poor fit for frontier LLMs; a compact boosted tree is easier to audit and cheap to run.

Deployment is a single Worker plus D1 on Cloudflare. Custom domain: gridcall.vincirufus.com.

How Verification Works (The Selling Point)

Most “AI for trading” demos are theater: impressive charts, no pre-commitment. Grid Call is built around falsifiability:

  1. No silent edits. Each ledger row hashes its content and the previous row’s hash. Note today’s tip hash; return later and walk the chain—any tampering breaks the link.
  2. Calls match the published model. Stored inputs are re-run through /api/model in the browser check at /#verify.
  3. Outcomes are Elexon’s. Every row links to the API responses used to score it.
  4. Backtest is reproducible. The pipeline is scripted; the CSV of backtest calls ships with the site.

What the chain does not prove: that the recorded “locked at” time is true. It proves the ledger was not rewritten after someone noted a hash. Independent timestamping is on the roadmap; the page says so plainly.

Limits You Should Read Before Acting

What’s Next

Near-term work is operational: monitoring for missed crons, serving archived model versions so old ledger rows stay checkable, and nailing Elexon attribution for any commercial reuse. Product direction—customer interviews with flexible-asset operators, asset simulators with real constraints, price forecasts with intervals, multi-period calls for assets that need longer notice—lives in the project roadmap.

If you operate flex in GB and want to stress-test the ledger against your own running costs, start at the live app and use the cost slider on the backtest chart. The model was tuned assuming £2/MWh to act; your wear, efficiency and fees may differ.

Frequently Asked Questions

Why not predict price levels with a large language model?

Because the problem is tabular, high-frequency and unforgiving of leakage. The features are lagged half-hour aggregates and public forecasts—not prose. A 100-tree depth-3 booster is inspectable, versioned and runs on Workers AI’s bill of zero marginal inference cost at the edge. LLMs belong in later roadmap items (for example parsing outage notices into features), not in the core spread regressor.

Isn’t this just momentum trading?

Mostly, yes—and we show that on the chart. The simple persistence rule makes money. Grid Call’s pitch is narrower: the same open data, a pre-registered call, and a measured gap in selectivity after realistic acting costs. If the gap closes in live trading, the ledger will show it; that’s the point.

Can I use this commercially?

Not yet as a packaged product—pricing, accounts and legal clearance are unfinished. The backtest and live ledger are research and decision-support demos on open data. Check Elexon’s licence before repurposing their feeds in a commercial dashboard.

How does this relate to Propensity One?

Propensity One asks whether a small fine-tuned model beats frontier LLMs on one narrow ranking decision (which ad wins). Grid Call applies the same philosophy to operations: a small model, a fixed decision schema, public evals—and here, a tamper-evident publication log because the decision has real money attached.


Projects