This is a Websocket-based service that pushes updates for EPEX Trades. To receive updates to trades, you must first subscribe to the EPEX trades push group.

Each time you subscribe to a new push group in a given day, it will count as 10 API calls towards your monthly API usage. For example, if you subscribe to EPEX trades and you have not previously subscribed to it that day, your API usage will be incremented by 10.


Using the LCPDelta Python Package

To receive updates to EPEX trades, you must subscribe to the EPEX trades push group using the subscribe_to_epex_trade_updates() method as shown below. You can then pass in your push handler method:

from lcp_delta import enact

def handle_new_information(x):
    # A callback function that will be invoked with the received trade updates.
    # The function should accept one argument, which will be the data received from the trades pushes.
    print(x)

dps_helper = enact.DPSHelper(username, public_api_key)

# Input method to handle trade pushes
dps_helper.subscribe_to_epex_trade_updates(handle_new_information)

message = None
while message != "exit()":
    message = input(">> ")

#Terminate the connection at the end
dps_helper.terminate_hub_connection()

Using our DPS Directly

To receive updates to an EPEX trade from Enact, you will need to follow the pattern detailed in Get Started with the Enact DPS in the language of your choice. You must first subscribe to the EPEX trade push group using a 'join object' in the format below:

{
  "type": "EPEX", // this should always be set to "EPEX"
  "group": "Trades" // this should always be set to "TRADES"
}

As explained in Get Started with the Enact DPS, once subscribed you can use the 'PushName' value (e.g. 'EPEX_Trades') from the confirmation response to handle point-level updates to trades.

Every push you receive will take the form of the JSON response object shown below.

{
  "messages": [
    {
      "errorCode": 0,
      "message": "string"
    }
  ],
  "data": {
    "trade": {
      "state": "Active",
      "quantity": 10,
      "price": 10,
      "executionTimeGmt": "2023-06-22T00:00:00",
      "revisionId": 1,
      "productType": "1H",
      "tradeId": 31022021
    },
    "contractId": 31022021
  }
}