Skip to content

Markets

The engine supports five electricity markets. Each can be independently enabled via the enabled_markets parameter in the run configuration.

json
{
  "run": {
    "enabled_markets": ["day_ahead", "intraday", "afrr", "fcr"]
  }
}

Market Overview

Day-Ahead (day_ahead)

The primary energy trading market. The optimizer buys energy when prices are low and sells when prices are high.

PropertyValue
Resolution15 minutes
Price fieldDA_price_15min
TypeEnergy arbitrage

Revenue is calculated as:

revenue = (discharge_mwh - charge_mwh) × price × 0.25

Day-ahead is the default market and is always enabled unless explicitly excluded.

Intraday (intraday)

Continuous intraday market for short-term trading. Uses the same charge/discharge logic as day-ahead but on intraday prices.

PropertyValue
Resolution15 minutes
Price fieldID3_price
TypeEnergy arbitrage

Intraday trading captures additional spread between day-ahead and intraday prices.

Imbalance (imbalance)

Real-time settlement based on the system imbalance direction. Unlike the energy markets, imbalance uses separate prices for charging and discharging.

PropertyValue
Resolution15 minutes
Price fieldsImb_Long_price (discharge), Imb_Short_price (charge)
Signal fieldsRegulation_State, signal
TypeBalancing energy

Revenue calculation:

revenue = discharge × imb_long_price - charge × imb_short_price

The optimizer uses regulation state signals to determine when imbalance trading is allowed:

StateMeaning
1Discharge favorable (system needs upward regulation)
-1Charge favorable (system needs downward regulation)
0, 2No trading allowed

aFRR — Automatic Frequency Restoration Reserve (afrr)

A two-stage market combining capacity reservation and energy activation.

Capacity Auction

The battery commits MW capacity for potential activation by the TSO. Capacity bids must be constant within each block.

PropertyValue
Block duration4 hours (German market) or 24 hours (configurable via afrr_block_hours)
Price fieldsafrr_capacity_up, afrr_capacity_down
capacity_revenue = capacity_bid × capacity_price × block_duration

Energy Activation

When activated, the battery responds with upward (discharge) or downward (charge) regulation.

PropertyValue
Price fieldsafrr_energy_up, afrr_energy_down
energy_revenue = activation_mw × energy_price × duration

Activation is limited by the committed capacity bid.

Allocation

Control how much battery power is available for aFRR:

  • max_afrr_allocation — maximum fraction of battery power for aFRR (0-1)
  • max_capacity_allocation — combined limit for aFRR + FCR

FCR — Frequency Containment Reserve (fcr)

Capacity-only market for primary frequency response. The battery reserves MW capacity that must remain available for frequency response at all times.

PropertyValue
Price fieldfcr_price
TypeCapacity reservation
revenue = capacity_bid × fcr_price × duration

Reserved FCR capacity is unavailable for energy trading. Control allocation with max_fcr_allocation.

Revenue Breakdown

Adjust the sliders to explore how revenue distributes across markets:

Example Annual Revenue Breakdown

Total: 195k EUR

Capacity Allocation

When both aFRR and FCR are enabled, the optimizer balances capacity between markets. Use the interactive diagram below to see how battery power is split:

Battery Power Allocation

aFRR 1.5 MW
FCR 1.0 MW
Energy 2.5 MW
aFRR: 1.5 MW (30%)
FCR: 1.0 MW (20%)
Energy trading: 2.5 MW (50%)

The optimizer enforces:

afrr_bid + fcr_bid ≤ battery_power × max_capacity_allocation

Remaining power after capacity allocation is available for energy markets (day-ahead, intraday, imbalance).

Solar & Wind Subsidies

Co-located solar and wind generation earn subsidy revenue independent of battery trading.

Subsidy Calculation

subsidy_revenue = Σ(generation_mw × subsidy_eur_mwh × 0.25)

Negative Price Shutdown

  1. Track consecutive 15-minute periods with negative DA prices
  2. If consecutive negative hours reach shutdownConsecutiveHours (default: 6), subsidies are withheld for remaining negative periods
  3. When prices turn positive, the counter resets

Generation continues during shutdown but without subsidy payment.

Grid Costs

Transport Costs

ParameterDescription
gridStandingChargeTransportFixed annual charge (EUR/year)
gridTransportedEnergyVariable charge per MWh (EUR/MWh)
gridYearlyTariffIncreaseAnnual escalation rate (default: 2%)

Power Limits

ParameterDescription
gridChargingCapacityMaximum charge power from grid (MW)
gridDischargingCapacityMaximum discharge power to grid (MW)
gridChargingCapacityByMonthPer-month charge limits (12-element array)
gridChargingCapacityByHourPer-hour-of-day charge limits (24-element array)