Market Data Feed

Bakkt provides a data feed via WebSocket connection for live digital asset market data. Clients can use the data feed to stream digital asset quotes directly to investors via their application.

Workflow

1. Get the Authorization Token

Prior to retrieving the market data feed, clients must get an authorization token using the Request Authorization Token (Login) endpoint. The token allows clients to successfully use the Configuration endpoint.

curl --request POST \
  --url https://api.bakkt.com/apex-crypto/api/v2/login \
  --header 'Content-Type: application/json' \
  --data '{
  "logonId": "username",
  "password": "password"
}'

Expected Response (200 OK):

{
  "token": "XbifasdSFD0EiJRnPJQqwRcqduFStK7svPTLge_sQ"
}

2. Receive the Market Data URL

Clients only need to retrieve the Market Data WebSocket URL once. The streaming data feed provides investors with current market data regarding digital assets including the symbol and current price. Use the Request Websockets and Transfer Status URLs endpoint to fetch the WebSocket URL.

curl --request POST \
  --url https://api.bakkt.com/apex-crypto/api/v2/config \
  --header 'Authorization: XbifasdSFD0EiJRnPJQqwRcqduFStK7svPTLge_sQ' \
  --header 'Content-Type: application/json' \
  --data '{}'

Expected Response (200 OK):

{
  "streamingOrderEntryEventUrl": "wss://api.bakkt.com/socket/order_entry/events",
  "streamingQuoteUrl": "wss://api.bakkt.com/socket/quotes",
  "streamingTransferStatusUrl": "wss://api.bakkt.com/socket/transfers/status"
}

3. Connect to the WebSocket

Client platforms can consume the market data by connecting to the WebSocket. Clients need a framework to handle JSON serialization to communicate with the Market Data Session (e.g., Twirp).

4. Use the WebSocket Stream

Users can then use the Market Data WebSocket URL in a command line to view the digital asset streaming output including symbol, current price, bid size, asking price and amount, along with a timestamp of the feed.

wscat -c wss://api.bakkt.com/socket/quotes?token=XbifasdSFD0EiJRnPJQqwRcqduFStK7svPTLge_sQ
Connected (press CTRL+C to quit)

Sample Market Data Output:

{"symbol":"GRTUSD","bid_price":"0.43513","bid_size":"4000","ask_price":"0.44456","ask_size":"4000","timestamp":"2022-02-18T10:38:26.342428354Z"}
{"symbol":"DASHUSD","bid_price":"107.77","bid_size":"20","ask_price":"110.2","ask_size":"20","timestamp":"2022-02-18T10:38:26.398695727Z"}

WebSocket Drivers

The following list provides links to commonly-used WebSocket drivers for popular programming languages.

Market Data Feed Details

The streaming data feed delivers real-time digital asset quotes with the following fields:

  • symbol — The instrument (e.g., BTCUSD)
  • bid_price — The best current bid price
  • bid_size — Quantity available at the bid price
  • ask_price — The best current ask price
  • ask_size — Quantity available at the ask price
  • timestamp — UTC timestamp of the quote