Skip to main content

Event Service

Event REST API

The Event REST API gives to access to Events.

It is accessed through the following URL:

https://api.opendatadsl.com/api/event
MethodPathExampleDescription
GETGet the build information for this service
GET{release}/{source}v1/privateGet a list of events
GET{release}/{source}/{id}v1/private/EXAMPLE:EVENTSGet events for an event list
PUT{release}/{source}/{id}/{version}/{tag}v1/private/EXAMPLE:EVENTS:ID_2024-05-30_M03/1/PRODTag a version with a name (which can be used instead of the version number when retrieving it)
DELETE{release}/{source}/{id}v1/private/EXAMPLE:EVENTS:ID_2024-05-30_M03Rollback an event to the previous version, if there are no other previous versions, the event will be deleted
DELETE{release}/{source}/{id}/{version}v1/private/EXAMPLE:EVENTS:ID_2024-05-30_M03/*Delete a specific version or use * to delete all versions
info

Note: You cannot update events directly, they must be updated attached to a master data record - see Examples

Event Object

An event is freeform apart from some fixed properties as shown below:

NameDescriptionType
_typeAlways 'VarEvent'String
_idA unique id for this event, it must be unique within the event listString
eventtimeDate when the event is recordedString Date
eventstartDate the event starts, defaults to eventtimeString date
eventendDate the event ends, defailts to eventtimeString date

If the event is used to create a curve, the following properties are also required:

NameDescriptionType
absoluteThe absolute tenor period codeString
relativeThe relative tenor period codeString

Using events

The power of events if to use them to dynamically create timeseries and curves. These are created using VarEventTimeseries and VarEventCurve

Event Timeseries

An event timeseries is dynamically created using events, the configuration of an event timeseries is shown below:

NameDescriptionType
_idA unique id for the timeseriesString
_typeAlways 'VarEventTimeseries'String
eventThe name of the eventlistString
propertyThe property name to use for the value of the observationsString
filterAn optional filter to use on the eventsString
calendarAn optional calendar to align the indexes, defaults to SPARSEString
indexOptional date field to use for the index used to build this TimeSeries, defaults to startString

Event Curve

The configuration of an event curve is shown below:

NameDescriptionType
_idA unique id for the curveString
_typeAlways 'VarEventCurve'String
eventThe name of the eventlistString
propertyThe property name to use for the value of the contractsString
filterAn optional filter to use on the eventsString
tenorThe name of the property in the event that this Curve uses as the tenor/maturity codeString
calendarThe expiry calendar for this CurveString
holidayCalendarThe holiday calendar for this Curve - this is used to determine what dates this curve should be published onString
sourceOptional source of the events used to build this CurveString
valueTransformationOptional value transformation expression to change all values in the curveString

Additional properties in curve contracts

If you want to add more properties to a curve contract such as a vendor provided identifier you can an include property containing either a string or array of strings, e.g.

{
"_id": "#ECB_IR.ESTR.EURO_SHORT_TERM_RATE:RATE",
"_type": "VarEventCurve",
"currency": "EUR",
"units": "PCT",
"name": "Euro short-term rate Curve",
"description": "",
"timezone": "UTC",
"event": "#ECB_IR.ESTR:CURVE",
"property": "obs_value",
"tenor": "relative",
"calendar": "#FEXPESTR",
"properties": {
"include": "key"
}
}

Examples

Example updating events

POST {{url}}/object
Authorization: Bearer {{token}}

{
"_id":"EXAMPLE",
"_type":"#Object",
"EVENTS":[
{
"_type": "VarEvent",
"_id": "ID_2024-05-30_M01",
"_dsid": "ODSL.TRADER1.NBP",
"eventtype": "TestEventType",
"eventtime": "2024-05-30",
"eventstart": "2024-06-01",
"eventend": "2024-06-30",
"absolute": "2024M06",
"relative": "M01",
"PRICE": 35.025
},
{
"_type": "VarEvent",
"_id": "ID_2024-05-30_M02",
"_dsid": "ODSL.TRADER1.NBP",
"eventtype": "TestEventType",
"eventtime": "2024-05-30",
"eventstart": "2024-07-01",
"eventend": "2024-07-31",
"absolute": "2024M07",
"relative": "M02",
"PRICE": 35.135
},
{
"_type": "VarEvent",
"_id": "ID_2024-05-30_M03",
"_dsid": "ODSL.TRADER1.NBP",
"eventtype": "TestEventType",
"eventtime": "2024-05-30",
"eventstart": "2024-08-01",
"eventend": "2024-08-31",
"absolute": "2024M08",
"relative": "M03",
"PRICE": 35.155
}
]
}

General examples

### Get example events
GET {{url}}/event/v1/private/EXAMPLE:EVENTS
Authorization: Bearer {{token}}

### Get some events with projection
GET {{url}}/event/v1/private
?event=EVENT_TEST:ORDERS
&_sort=eventtime
&_project=eventtime,price
Authorization: Bearer {{token}}

### Get an event
GET {{url}}/event/v1/private/EVENT_TEST:ORDERS:ORDER1
Authorization: Bearer {{token}}

### Rollback an event to the previous version
DELETE {{url}}/event/v1/private/EXAMPLE:EVENTS:ID_2024-05-30_M03
Authorization: Bearer {{token}}

### Delete an event
DELETE {{url}}/event/v1/private/EXAMPLE:EVENTS:ID_2024-05-30_M03/*
Authorization: Bearer {{token}}

### Get a list of versions of an event
GET {{url}}/event/v1/private/EVENT_TEST:ORDERS:ORDER1/*
Authorization: Bearer {{token}}

### Get a version of an event
GET {{url}}/event/v1/private/EVENT_TEST:ORDERS:ORDER1/1
Authorization: Bearer {{token}}

### Tag a version of an event
PUT {{url}}/event/v1/private/EVENT_TEST:ORDERS:ORDER1/3/TEST
Authorization: Bearer {{token}}

### Get a tagged version of an event
GET {{url}}/event/v1/private/EVENT_TEST:ORDERS:ORDER1/TEST
Authorization: Bearer {{token}}

Event timeseries and curves

### Create an event timeseries
POST {{url}}/object
Authorization: Bearer {{token}}

{
"_id": "EVENT_TEST",
"_type": "#Object",
"_links": {},
"ASK_TS": {
"_id": "ASK_TS",
"_type": "VarEventTimeSeries",
"event": "EVENT_TEST:ORDERS",
"property": "price",
"filter": "{'side': 'ASK'}"
}
}

### Create an event curve
POST {{url}}/object
Authorization: Bearer {{token}}

{
"_id": "PZEM.ZTP.TEST",
"_type": "#Object",
"SETTLE": {
"_id": "SETTLE",
"_type": "VarEventCurve",
"event": "PZEM.ZTP.TEST:EVENTS",
"property": "SETTLEMENT_PRICE",
"tenor": "absolute",
"calendar": "#REOD",
"timezone": "Europe/Amsterdam"
}
}

### Create an event curve with value transformation
POST {{url}}/object
Authorization: Bearer {{token}}

{
"_id": "AAA",
"_type": "#Object",
"_links": {},
"VTEC": {
"_id": "VTEC",
"_type": "VarEventCurve",
"name": "test",
"event": "AAA:ECE",
"property": "price",
"valueTransformation": "value * 1.1",
"tenor": "absolute",
"calendar": "#REOMB"
}
}