# Energy contracts

> Configure the energy contract so the EMS knows how each quarter-hour becomes a net consumption price and a net injection price to plan against.

Source: https://voltmasters.io/en/docs/voltmasters-platform/project-settings/energy-contracts/

The energy contract tells the EMS how the market translates into the prices it actually plans against. The EMS never acts on a raw market price directly: your contract determines how each quarter-hour becomes a **net consumption price** (what you pay to import) and a **net injection price** (what you earn or pay to inject). Those two net prices drive every price-based decision, including PV curtailment and [cost optimization](https://voltmasters.io/en/docs/control-algorithms/cost-optimization/).

You configure the contract under **Configuration → Grid & market → Energy contract** (see [Project settings](https://voltmasters.io/en/docs/voltmasters-platform/project-settings/general-settings/#energy-contract)).

> **Note**
>
> When you save a new contract, the platform recalculates the upcoming energy prices for this project. Prices already in the past keep the values they were calculated with, so a chart can show market-following prices up to the switch and the new contract's prices afterwards.

### Contract types

| Type | How prices are determined |
| --- | --- |
| **Dynamic** | Follows the quarter-hourly / hourly day-ahead market (EPEX spot). Net prices are derived from the market price via scaling factors and fixed cost components. Best suited for the [Cost Optimisation](https://voltmasters.io/en/docs/voltmasters-platform/project-settings/general-settings/) strategy. |
| **Flexible** | A fixed price per MWh that your supplier revises periodically (for example monthly or quarterly). Between revisions it behaves like a fixed contract. |
| **Fixed** | A single price per MWh agreed in advance for the whole contract and independent of the market. |
| **Fixed (Spain, time-of-use)** | A Spanish access tariff (3.0 TD / 6.1 TD / 6.2 TD) with a different fixed price per **tariff period** (P1–P6). Only available for projects located in Spain. |

### Dynamic

The net prices are computed from the market price with your scaling factors and per-MWh costs. The exact formulas and a worked example are documented in [Energy price calculation](https://voltmasters.io/en/docs/voltmasters-platform/project-settings/energy-price-calculation/). If you leave a parameter blank, the EMS falls back to default values.

### Fixed and Flexible

You enter a single **consumption price** and **injection price** in €/MWh. Every quarter-hour uses the same value, so the price line is flat and independent of the market. A *Flexible* contract works identically; re-enter the price whenever your supplier revises it.

### Fixed (Spain, time-of-use)

In Spain, fixed tariffs are not a single price. Under CNMC Circular 3/2020 (Iberian Peninsula), every quarter-hour is classified into one of six **tariff periods**, from **P1** (most expensive) to **P6** (cheapest), and each period has its own price. This contract type lets you enter one fixed price per period; the platform automatically applies the correct period to each quarter-hour based on the date and time.

> **Note**
>
> This contract type only appears in the dropdown for projects whose country is set to Spain.

You enter **six prices** (€/MWh), one per period P1–P6. The period that applies to a given quarter-hour depends on three factors, evaluated in Spanish local time (Europe/Madrid):

**1\. Day type**

-   **Weekends and national holidays** → the whole day is **P6**.
-   **Working days** → the period depends on the season and the hour (below).

**2\. Time block (working days)**

| Block | Hours | Result |
| --- | --- | --- |
| **Peak** | 09:00–14:00 and 18:00–22:00 | Peak period for the season |
| **Shoulder** | 08:00–09:00, 14:00–18:00 and 22:00–24:00 | Shoulder period for the season |
| **Valley** | 00:00–08:00 | Always **P6** |

**3\. Season (by month)**

| Season | Months | Peak block → | Shoulder block → |
| --- | --- | --- | --- |
| High | January, February, July, December | **P1** | **P2** |
| Medium-high | March, November | **P2** | **P3** |
| Medium | June, August, September | **P3** | **P4** |
| Low | April, May, October | **P4** | **P5** |

In practice this means a working day uses **three** prices, the night/valley (P6) plus the season's peak and shoulder period, while a weekend or national holiday uses a **single** price (P6).

The national holidays that count as all-day P6 are the fixed-date Spanish electrical holidays:

| Date | Holiday |
| --- | --- |
| 1 January | New Year's Day |
| 6 January | Epiphany |
| 1 May | Labour Day |
| 15 August | Assumption |
| 12 October | National Day |
| 1 November | All Saints' Day |
| 6 December | Constitution Day |
| 8 December | Immaculate Conception |
| 25 December | Christmas Day |

> **Warning**
>
> Movable feasts without a fixed calendar date (Good Friday, Holy Thursday, etc.) and regional/local holidays are **not** treated as P6, they follow the normal working-day rules, in line with the CNMC fixed-date definition.

**Injection.** Under these Spanish contracts, energy is not sold back to the grid, so the **injection price is always 0**.

> **Note**
>
> The underlying spot data for Spain is sourced from the ENTSO-E transparency platform (the Spanish bidding zone), which reflects the same day-ahead market outcome as OMIE. For a *fixed time-of-use* contract the spot price is not used for pricing, only the tariff period of each quarter-hour matters.

### Where these prices are used

-   **PV curtailment**: PV production is limited when the net injection price is negative.
-   [**Cost optimization**](https://voltmasters.io/en/docs/control-algorithms/cost-optimization/): the battery is charged and discharged based on the net consumption and injection prices across the forecast.
-   [**Energy price calculation**](https://voltmasters.io/en/docs/voltmasters-platform/project-settings/energy-price-calculation/): the formulas that turn a dynamic contract's market price into net prices.
-   [**Energy cost on the energy meter dashboard**](https://voltmasters.io/en/docs/voltmasters-platform/dashboards/energy-meter-dashboard/energy-cost/): the contract you enter here is what that dashboard values your metered energy at. It also explains why that amount is an indication and not a settlement.
