Contract Evolution Endpoint
This endpoint returns the contract evolution for a specified commodity contract. For each trading day, it provides the closing Bid, Offer, and Mid prices.
If requesting via our python package, the response is returned as a DataFrame with:
Bid
,Offer
, andMid
as columns- One row per trading day
- The trading day as the index
For example:
Day | Bid | Offer | Mid |
---|---|---|---|
2025-01-02T00:00:00 | 92.4 | 92.6 | 92.5 |
2025-01-03T00:00:00 | 91.5 | 91.8 | 91.6 |
Required Parameters
To retrieve data, you must specify both:
- The instrument (commodity type)
- The contract (delivery product)
Supported Instruments
The following instruments are currently available:
"Nbp"
"NbpPoundPerMwh"
"Eua"
"UkaFutures"
"UkPeak"
"UkBaseload"
Each instrument supports a subset of the available contract types.
Supported Contracts
A full list of contract types across all instruments:
"Spot"
, "WithinDay"
, "DayAhead"
, "BalanceOfWeek"
, "Weekend"
, "WorkingDaysNextWeek"
,
"Week"
, "BalanceOfMonth"
, "Month"
, "Quarter"
, "Season"
, "Annuals"
, "CalendarYear"
Note: Some instruments do not support all contract types. See the table below for a breakdown.
Instrument vs. Supported Contracts
Instrument | Supported Contracts |
---|---|
Nbp or NbpPoundPerMwh | WithinDay, DayAhead, BalanceOfWeek, Weekend, WorkingDaysNextWeek, BalanceOfMonth, Month, Quarter, Season, Annuals, CalendarYear |
Eua | Spot, CalendarYear |
UkaFutures | CalendarYear |
UkBaseload | Week, Month, Quarter, Season, Annuals |
UkPeak | Week, Month, Quarter, Season, Annuals |
Contract Periods
For contracts of type "Month"
, "Quarter"
, "Season"
, "Annuals"
, and "CalendarYear"
, you must specify a contract_period
. This indicates the specific delivery period (e.g., which month or quarter) the contract refers to.
The table below outlines the required format for each contract_period
type.
Note:
For contracts like"Spot"
,"DayAhead"
,"WithinDay"
,"Weekend"
,"Week"
, and"BalanceOfWeek"
, a specificcontract_period
is not required. Although there are technically multiple such contracts, only one is traded per day, making it unambiguous for the API.
contract_period
Format by Contract Type
contract_period
Format by Contract TypeContract Type | Example contract_period | Description |
---|---|---|
Month | Sep-25 | 1-month contract for September 2025 |
Quarter | Q323 | Q3 of 2023 |
Season | S-26 | Seasonal contract for Summer 2026 |
Annuals | Oct Annual 25 | Annual contract starting October 2025 |
Apr Annual 25 | Annual contract starting April 2025 | |
CalendarYear | 2026 | Full calendar year 2026 |
Note: The formatting must exactly match the expected pattern (e.g.,
"Sep-25"
not"September 2025"
).
📅 Date Range
There are two optional parameters: date_from
and date_to
.
- If neither is provided, the full dataset will be returned showing closing prices for all trading days on which the contract was traded.
- If only
date_from
is provided, the dataset will include all trading days from that date onward. - If only
date_to
is provided, the dataset will include all trading days up to and including that date. - If both are provided, the dataset will include all trading days within the specified range.
Using the LCPDelta Python Package
Synchronous
from lcp_delta import enact
enact_api_helper = enact.APIHelper(username, public_api_key)
# see 'BODY PARAMS' section below for details on corresponding parameter values
response_dataframe = enact_api_helper.get_contract_evolution(
"UkBaseload",
"Quarter",
"Q225"
)
print(response_dataframe)
Asynchronous
from lcp_delta import enact
import asyncio
async def main():
enact_api_helper = enact.APIHelper(username, public_api_key)
# see 'BODY PARAMS' section below for details on corresponding parameter values
response_dataframe = enact_api_helper.get_contract_evolution_async(
"UkBaseload",
"Quarter",
"Q225"
)
print(response_dataframe)
asyncio.run(main())
Using the API Directly
Response
The response from this endpoint will be a JSON object with the following structure:
messages
: An array of system messages (typically empty if the request is successful).data
: A 2D array where:- The first row contains column headers:
Day
,Bid
,Offer
, andMid
. - Each subsequent row contains the corresponding values for each trading day.
- The first row contains column headers:
{
"messages": [],
"data": [
["Day", "Bid", "Offer", "Mid"],
["2024-07-01T00:00:00", 83.25, 83.45, 83.35],
["2024-07-02T00:00:00", 84.0, 84.2, 84.1]
]
}