Flexibility Asset Trading Analytics Accelerator
Reserve-market trading analytics for flexibility assets (BESS, demand response, thermal) across FCR-N/D, aFRR, mFRR. Modular TVFs for asset metadata, offers, results, and per-market performance, plus a dependency-free KPI library + offline tests. Fully generic and currency-neutral.
⚙ Try the Live Demo interactive
Set offered MW, acceptance rates and prices across reserve markets and see revenue and acceptance KPIs — the same aggregation as the trades_sum TVF.
⚡ Open Revenue Simulator📋 What's Inside 17 files
- ✓ README.md
- ✓ LICENSE
- ✓ manifest.json
- ✓ databricks.yml
- ✓ resources/jobs.yml
- ✓ src/tvfs/asset_metadata.sql
- ✓ src/tvfs/market_offer.sql
- ✓ src/tvfs/market_result.sql
- ✓ src/tvfs/trades_sum.sql
- ✓ lib/trading_kpis.py
- ✓ tests/test_trading_kpis.py
- ✓ conftest.py
- ✓ guide/01_what-you-get.md
- ✓ guide/02_getting-started.md
- ✓ guide/03_architecture.md
- ✓ guide/04_support.md
- ✓ guides/flexibility-trading-methodology.md
📁 File Structure 17 files
├── README.md
├── LICENSE
├── manifest.json
├── databricks.yml
├── resources/
│ ├── jobs.yml
├── src/
│ ├── tvfs/
│ │ ├── asset_metadata.sql
│ │ ├── market_offer.sql
│ │ ├── market_result.sql
│ │ ├── trades_sum.sql
├── lib/
│ ├── trading_kpis.py
├── tests/
│ ├── test_trading_kpis.py
├── conftest.py
├── guide/
│ ├── 01_what-you-get.md
│ ├── 02_getting-started.md
│ ├── 03_architecture.md
│ ├── 04_support.md
├── guides/
│ ├── flexibility-trading-methodology.md
📖 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, efficiency
- `market_offer(start, end)` — submitted bid volumes + prices
- `market_result(start, end)` — accepted volumes + revenue
- `trades_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
```bash
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
... preview truncated, see full README in product download.