← Back to all products

Flexibility Trading Analytics Accelerator

$1990

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.

17 filesv1.0.0
PythonMarkdownSQLYAMLJSONDatabricks

Product Preview

Try the interactive reader and demo tools below, or get the full product with all content unlocked.

⚙ Try Demo Tools

File Structure 17 files

flexibility-trading-accelerator/ ├── LICENSE ├── README.md ├── conftest.py ├── databricks.yml ├── guide/ │ ├── 01_what-you-get.md │ ├── 02_getting-started.md │ ├── 03_architecture.md │ └── 04_support.md ├── guides/ │ └── flexibility-trading-methodology.md ├── lib/ │ └── trading_kpis.py ├── resources/ │ └── jobs.yml ├── src/ │ └── tvfs/ │ ├── asset_metadata.sql │ ├── market_offer.sql │ ├── market_result.sql │ └── trades_sum.sql └── tests/ └── test_trading_kpis.py

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


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.

Code Sample .py preview

conftest.py import os,sys sys.path.insert(0, os.path.dirname(__file__))