Alpiq BESS

Battery Energy Storage System (BESS) optimization platform — part of Alpiq’s Sales & Origination / Flexible Assets division.

Overview

The BESS platform manages trading, scheduling, and optimization workflows for battery energy storage assets. It handles market data ingestion, algorithm execution, flow orchestration, and integration with external systems (Volue EMS, Alpiq internal APIs, Fingrid).

Repository

Reposales-and-origination/flexible-assets/bess/poc/mando
HostGitLab
Main branchdevelop
LanguageRust 1.88.0 (edition 2021) + Python 3.12
Version1.4.11

Architecture

The project is a Rust Cargo workspace with Python bindings via PyO3:

graph TD
    subgraph "Mando Workspace"
        LIB["[[mando-lib]]<br/>Core Library"]
        MACRO["[[mando-lib-macro]]<br/>Proc Macros"]
        BESS["[[mando-bess]]<br/>REST API Service"]
        PY["[[py-mando]]<br/>Python Bindings"]
        SCRT["[[mando-scrt]]<br/>Python Runtime"]
    end

    CLI["[[mando-cli]]<br/>Workflow Orchestrator"]

    MACRO --> LIB
    LIB --> BESS
    LIB --> PY
    LIB -.-> SCRT
    CLI -.->|"manages"| BESS

    subgraph "External Systems"
        VOLUE["Volue EMS/ATP"]
        ALPIQ["Alpiq EBS/MDR/OPL"]
        FINGRID["Fingrid"]
    end

    LIB --> VOLUE
    LIB --> ALPIQ
    LIB --> FINGRID

    subgraph "Storage"
        PG["PostgreSQL"]
        DUCK["DuckDB"]
        SQLITE["SQLite"]
    end

    LIB --> PG
    LIB --> DUCK
    LIB --> SQLITE

See Mando for the full workspace breakdown.

Crates

CratePurpose
mando-libCore library — data models, repository pattern, service layer, adapters
mando-lib-macro#[derive(ErrorCode)] procedural macro
mando-bessMain REST API service — flows, routes, scheduling
py-mandoPyO3 extension module — exposes Rust to Python algorithms
mando-scrtRust-based Python runtime — virtual modules, Arrow FFI, memory-safe algo hosting
mando-cliYAML-driven workflow orchestrator — local dev stack management, replaces run.py

Key Concepts

Data Points

Hierarchical time series identifiers like Asset/FI/Battery/SoC. Each data point has a type (TimeSeriesDouble, TimeSeriesDoubleMatrix, StaticData), metadata, and validation schema. Data is stored as Polars DataFrames.

Flows

Versioned workflow execution engines (v1, v2, v3) for trading strategies:

  • Trading — market trading decisions
  • Manual Schedule — operator-defined schedules
  • Auction — auction bidding
  • Intraday / IDC Trading — intraday market operations
  • Data Update — data refresh pipelines
  • AFRR — automatic frequency restoration reserve

Repository Pattern

Trait-based abstraction (Repository, DataPointRepository, CacheRepository) with pluggable backends: PostgreSQL, DuckDB, SQLite, and a Passthrough caching layer.

MandoService

Central async trait for data access — retrieve, insert, send, filter data points across backends.

Infrastructure

See Mando CI-CD for CI/CD pipeline, Docker images, and deployment details. See Local Docker Setup for running the full stack locally (Docker Compose + WireMock mocking).

Quick Reference

# Build
cargo build
 
# Test
cargo test
 
# Run service
cd mando-bess && cargo run
 
# Python build
cd py-mando && maturin develop