Flexibility Trading Analytics Accelerator
Trading analytics for batteries and demand-response assets in reserve markets (FCR-N/D, aFRR, mFRR): asset registry, availability, offers/results, and strategy comparison via modular SQL TVFs.
Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
⚙ Try Demo ToolsFile Structure 17 files
Documentation Preview README excerpt
Flexibility Asset Trading Analytics Accelerator
A complete trading-analytics platform for flexibility assets — batteries
(BESS), demand response, and thermal flexibility — participating in reserve
markets (FCR-N, FCR-D, aFRR, mFRR). Built on modular **table-valued
functions** so every dashboard reads from a stable, composable interface.
Fully generic: configure your own catalog/schema, map your asset registry and
trading source tables, and set your TSO's market IDs. Currency-neutral.
What it answers
- What did each asset offer vs. what cleared each market? (acceptance rate)
- What revenue did each asset/market earn?
- How does the portfolio perform per market (FCR-N vs aFRR vs mFRR)?
- What would an alternative bidding strategy have earned? (strategy uplift)
Architecture
All analytics call TVFs parameterized by (start_date, end_date):
asset_metadata()— registry with power/energy capacity, SoH, efficiencymarket_offer(start, end)— submitted bid volumes + pricesmarket_result(start, end)— accepted volumes + revenuetrades_sum(start, end)— offered vs accepted, acceptance rate, revenue
The same aggregation is reproduced in lib/trading_kpis.py (pure Python), so you
can validate KPIs and run strategy comparisons offline.
What's inside
- Databricks Asset Bundle — daily job deploying the TVFs.
- Four composable TVFs — currency-neutral, timezone-configurable.
- A dependency-free KPI library (
lib/trading_kpis.py): acceptance rate,
per-market summary, portfolio totals, and strategy comparison.
- An offline test suite (
tests/, 6 passing tests).
Quickstart
pip install pytest && pytest tests/ -v # validate KPIs offline
databricks bundle deploy -t dev -p <profile>
Map your source tables (market_offers, market_results, and the registry
asset_metadata) to the schemas in guide/03_architecture.md, and set your
market IDs.
License
MIT — see LICENSE.