โก flexpool
An open-source virtual power plant for aggregators. flexpool pools batteries, homes and depots, plans them against day-ahead prices, offers their flexibility to grid operators and proves what was delivered. Every number is exact, every decision has a reason, and every step can be replayed.
๐ Documentation ยท ๐ Getting started ยท ๐ API ยท ๐ Changelog
๐งช Experimental. Pre-1.0: APIs can change between releases. Everything runs end to end on simulated and replayed market days; orders are paper orders, no exchange is connected, and devices are only ever read. Test with your counterparties before production use.
๐ Quick start
&&
The demo replays a market day on a test clock, with 400 assets in two pools. Some of the API:
๐ฆ From source (Rust 1.100, just): just run starts the daemon,
just ci runs every check.
๐งฐ The command line checks portfolios, scenarios and alarm journals offline:
๐ฅ๏ธ The desk
Calm by default, loud on exception. Every value shows its age, every order has a reason, and nothing reaches a market until a person releases it. In German and English, light and dark.
| ๐ Book and delivery: the release with its digest, positions after the auction, the Fahrplan against measured power | ๐ Timeline: prices, the forecast fan and every model scored over 14 days |
| ๐ค Flexibility: a grid operator's request answered, sent by a person, the settlement recomputed | ๐งญ Overview: what matters now, readable in five seconds |
โจ What it does
| ๐ | Portfolio as code | Owners, pools, technical units and assets in portfolio.toml and assets.csv, checked down to every MaLo check digit |
| ๐ก | Telemetry | Simulated in the sandbox, or read from SunSpec and IEC 60870-5-104 devices, read-only, with a quality on every value |
| ๐จ | Alarms | One alarm per cause (ISA-18.2), acknowledged on a hash-chained journal, handed over between shifts, paged as signed CloudEvents |
| ๐ฎ | Forecast | Day-ahead price quantiles, scored against published prices, with a place for your own model |
| ๐งฎ | Plan | Scenarios and a storage optimiser with a risk knob: a schedule, water values and protective orders per battery pool |
| ๐ | Book | Pre-trade checks, a release a person makes, a kill switch, positions and the Fahrplan |
| โก | Delivery | The Fahrplan against measured power, the running quarter projected, and what to trade back |
| ๐ฌ | Explanations | Warum? on every order from its facts; Nachrechnen recomputes any release from its journal record |
| ๐ค | Flexibility market | UFTP 3.1 requests become offers built from the units behind a congestion point; every settlement is recomputed before it is accepted |
| ๐ | Interfaces | REST with OpenAPI 3.1, CloudEvents with published schemas, Standard Webhooks, read-only MCP tools, W3C Trace Context |
| ๐ | Data protection | Personal data declared on every event; erasure@1 acted on and confirmed truthfully |
๐๏ธ Workspace
| Component | Purpose |
|---|---|
| flexpool-core | Exact units, the Berlin quarter-hour calendar, the single float-to-decimal boundary |
| flexpool-portfolio | Parse, check, query and summarise the portfolio |
| flexpool-telemetry | Measurement quality, the live store, quarter-hour means, the sandbox simulator |
| flexpool-alarms | The alarm engine, the hash-chained journal, handover and KPIs |
| flexpool-forecast | Probabilistic day-ahead forecasts and their scoring |
| flexpool-plan | Scenarios, the storage optimiser with CVaR, water values, orders |
| flexpool-rules | Dated market and alarm rules, each citing its source (rules/) |
| flexpool-sim | Bitemporal market data, scenarios, the test clock and replay |
| flexpool-adapters | Read-only SunSpec Modbus TCP and IEC 60870-5-104 sessions |
| flexpool-files | Bounded, contained reads of the files an operator keeps |
| flexpool-service | The HTTP shell: configuration, authentication, limits, problem documents, trace context |
| flexpoold | The daemon: API, MCP, events, the flexibility market |
| flexpool | The offline command line; it never links the daemon |
| desk | The operator desk (React, TypeScript), served by flexpoold |
| xtask | The repository guards just ci runs |
๐ฏ The domain crates read no clock, do no I/O and spawn no task. Money and energy are exact decimals, and business time is the Europe/Berlin quarter hour.
๐ Part of the Open Utility Stack
flexpool fills the aggregator role in the
Open Utility Stack. It follows the stack's
conventions for events, contracts and autonomy, so its counterparts, like
fms on the grid operator's side, can be replaced by any
system that follows them too. platform.toml declares what it emits and
consumes.
๐ค Contributing and security
- ๐ ๏ธ CONTRIBUTING.md: build, test and the repository guards
- ๐ค AGENTS.md: the rules for AI coding agents
- ๐ก๏ธ SECURITY.md and the threat model
๐ License
Licensed under either MIT or Apache-2.0, at your option.