Market¶
What is a Session?¶
A Session corresponds to one Imbalance Settlement Period (ISP) — a 15-minute interval aligned with smart meter reading resolution and OMIE's market time granularity. Sessions are the atomic unit for market clearing and settlement.
Session Lifecycle¶
stateDiagram-v2
[*] --> OPEN: Session created
OPEN --> CLEARED: Market clearing runs
CLEARED --> SETTLED: Settlement computed
SETTLED --> [*]
| Status | Description |
|---|---|
OPEN |
Session is active; meter data can be uploaded |
CLEARED |
Market has cleared; transactions recorded |
SETTLED |
Financial settlement computed for all members |
Local Energy Market (LEM)¶
In the LEM, members with surplus energy (producers/prosumers) trade with members needing energy (consumers). The market clearing algorithm matches offers and determines:
- Who buys from whom
- The clearing price (€/kWh)
- The traded quantity (kWh)
Pricing¶
The internal trading price is derived from the community's market_rate:
| Rate | Price Derivation |
|---|---|
VANILLA_INTERMEDIATE_MARKET_RATE |
price = OMIE day-ahead spot price × market_divisor |
VANILLA_SDR |
price derived from supply-demand ratio within the community |
VANILLA_CV |
price derived from crossing value of buy/sell curves |
FIXED_PRICE |
fixed value set in community configuration |
BILATERAL_PRICE |
agreed bilaterally between members before market clearing |
TREE_DNAC |
dynamic allocation coefficients computed via decision-tree algorithm; price determined by the bilateral agreement between Promoter and each receiver |
Contract dependency
Mechanisms that reference OMIE prices or retailer rates (e.g. VANILLA_INTERMEDIATE_MARKET_RATE,
INDEXED) require valid contract information for each CPE.
Transactions¶
Each cleared trade generates a Transaction record with:
| Field | Description |
|---|---|
datetime_timestamp |
Start of the 15-minute ISP interval (Portuguese timezone) |
provider_resource_id |
Resource selling energy |
receiver_resource_id |
Resource buying energy |
provider_user_id |
Member who owns the selling resource |
receiver_user_id |
Member who owns the buying resource |
provider_meter_id |
DSO meter behind the selling resource |
receiver_meter_id |
DSO meter behind the buying resource |
transaction_type |
INTRA_CPE or PUBLIC_CPE |
price |
Price before grid-access tariffs (€/kWh) |
energy |
Energy traded (kWh) |
Transaction Types¶
| Type | Description |
|---|---|
INTRA_CPE |
Both resources are behind the same DSO meter. No self-consumption grid-access tariff applies |
PUBLIC_CPE |
Resources are behind different DSO meters connected through the public grid (RESP). The buyer is charged the self-consumption grid-access tariff |
Ownership and compensation
If a transaction occurs between two resources with fractional ownership, the resulting compensation — whether paid or received — is allocated to each resource's owners in proportion to their ownership shares.
Meter Data Format¶
For market clearing to run, meter data must be uploaded for every 15-minute ISP. The required fields depend on the meter type:
| Field | Description |
|---|---|
surplus |
Surplus energy allocated to this consumer meter (kWh) |
imputed_energy |
Share of total injected energy allocated to this consumer meter (kWh) |
grid_sc |
Self-consumed energy from the public grid (kWh) |
| Field | Description |
|---|---|
consumption |
Energy consumed behind the meter (kWh) |
generation |
Energy generated behind the meter (kWh) — optional |
| Field | Description |
|---|---|
total_surplus |
Total surplus allocated to all consumer meters (kWh) |
sharing_energy |
Total energy injected by all prosumer meters (kWh) — optional |