Skip to main content

Market Data API Overview

The BPX customer WebSocket API can provide real-time market data that includes instrument orderbook, trade and statistics updates. The specification applies to all customers wishing to connect to the BPX MTF. It covers session-level protocols, application message formats, and example business workflows mapped to WebSocket update message types.

Within this documentation, the following terms will be used to represent message initiators:

  • BPX MTF - BPX is the initiating party of a message.
  • Customer – BPX Member, technical integration vendor or other party connecting to the BPX MTF via the FIX API is the initiating party of a message.
  • Both – Either BPX MTF or the Customer is the initiating party of a message.

Technical Connectivity

The following details will be provided during technical onboarding per test and production technical connection to be setup:

  • WebSocket API URL and port number
  • REST API URL and port number
  • API client_id
  • API client_secret

BPX supports a TCP peer-to-peer connection type with TLS 1.3. For connection availability please see the BPX market services documentation.

All WebSocket API requests require a valid JWT token. This token can be obtained by authenticating via the BPX REST API and requires to be refreshed within a specified period of time. The refresh time period will be provided on the BPX MTF authorisation response.

WebSocket Stream Requests and Responses

Stream Management

/stream

The streams WebSocket URL can be used to subscribe or unsubscribe for market data or session information.

Table 1 - Stream Subscription or Unsubscribe Request Parameters

Field NameRequired (Y/N)Description and Supported Values
eventYStream definition and subscribe or unsubscribe request.
Supported Value Set
cl_stream_idYSession stream ID set by customer. Will be used as the customer stream ID reference in all responses related to this request.

The initial request ID can be used to unsubscribe from the stream.
channelsNList of channels to subscribe or unsubscribe to.
Required for subscribe type requests.
Supported Value Set
instrument_idsNStream will be configured to filter on updates related to provided list of instruments.
Required for subscribe type requests.
instrument_typeNType of instrument identifier.
Required for subscribe type requests.
Supported Value Set

Subscribe Request Example

{
"event": "subscribe",
"cl_stream_id": "allChannelsandMkts.1",
"channels": ["orderbook", "trades", "statistics"],
"instrument_id": ["GB00B0XWNN66"],
"instrument_type": "ISIN",
}

Unsubscribe Request Example

{
"event": "unsubscribe",
"cl_stream_id": "allChannelsandMkts.1"
}

Table 2 - Stream Subscription or Unsubscribe Response Parameters

Field NameRequired (Y/N)Description and Supported Values
cl_stream_idYSession stream client ID specified in initial stream request.
eventYStream definition and subscribe or unsubscribe request.
Supported Value Set
statusYConfirmation or reject of stream request.
Supported Value Set
timestampYTime of stream setup generated by the BPX MTF.

Acknowledgement Response Example

{
"cl_stream_id": "allChannelsandMkts.1",
"event": "subscribe",
"status": "ack",
"timestamp": "2025-02-20T10:00:00.000Z",
}

Reject Response Example

{
"cl_stream_id": "allChannelsandMkts.1",
"event": "unsubscribe",
"status": "nack",
"reject_reason": "Stream ID invalid",
"timestamp": "2025-02-20T10:00:00.000Z",
}

Stream Updates

BPX will stream relevant information real-time until the stream is unsubscribed from. All clients should send unsubscribe requests for all requested subscriptions before the system technical end of day that is specified in the market services description. BPX MTF will stop sharing stream updates at the end of each trading session as specified in the market services description. Updates will not be sent at the start of the next trading session without a new subscription request.

During peak data sharing periods, BPX may compress market data events using the following processes:

  • Share the latest top 5 buy and sell side orderbook updates if there are multiple orderbook updates within a period of 1 second.
  • Share a list of trade updates at per instrument level per update if there are multiple trades within a period of 1 second.
  • Share the latest statistics per instrument if updated multiple times within a period of 1 second.

Table 3 - Stream Update Parameters

Field NameRequired (Y/N)Description and Supported Values
cl_stream_idYSession stream client ID specified in initial stream request.
channelYChannel update is related to.
Supported Value Set
eventYUpdate event.
Supported Value Set
timestampYTime of update.
instrument_idYInstrument ID update is related to.
instrument_typeYType of instrument identifier.
Supported Value Set
dataYData will be dependent on the type of channel.
Orderbook data will be a list of two elements:
List of top 5 buy order size and price.
List of top 5 sell order size and price.
Trades data will be a list of time and sales within the last 1 second period.
Statistics data will be a single dataset of the latest statistics within the last 1 second period.

Orderbook Stream Channel Update Example

{
"channel": "orderbook",
"cl_stream_id": "allChannelsandMkts.1",
"event": "update",
"timestamp": "2025-02-20T10:00:00.000Z",
"instrument_id": "GB00B0XWNN66",
"instrument_type": "ISIN",
"data": [
"buy": [
{
"size": "150",
"price": "95.80"
}
],
"sell": []
]
}

Trade Stream Channel Update Example

{
"channel": "trades",
"cl_stream_id": "allChannelsandMkts.1",
"event": "update",
"timestamp": "2025-02-20T10:00:00.000Z",
"instrument_id": "GB00B0XWNN66",
"instrument_type": "ISIN",
"data": [
{
"price": "94.67",
"size": 100,
"timestamp": "2025-02-20T09:59:59.051Z",
"side": "buy"
}
]
}

Instrument Statistics Update Example

{
"channel": "statistics",
"cl_stream_id": "allChannelsandMkts.1",
"event": "update",
"timestamp": "2025-02-20T10:00:00.000Z",
"instrument_id": "GB00B0XWNN66",
"instrument_type": "ISIN",
data: {
"open": "93.56",
"high": "103.45",
"low": "92.89",
"ltp": "97.34", // Last Traded Price
"cp": "93.56", // Closing Price
"srp": "98.00", // Static Reference Price
"drp": "97.34" // Dynamic Reference Price
"volume": 1000000,
"timestamp": "2025-02-20T09:59:59.051Z"
}
}