Skip to main content

Heartbeats Channel

Heartbeats indicate the current timestamp, as well as the number of messages sent.

Products Channel

Returns the full list of products available on Prime, along the corresponding product metadata:

Orders Channel

The orders channel provides real-time updates on orders you’ve made.

Python Example

Below is a detailed end to end Python script for subscribing to the orders channel:
This script is open source and available on GitHub.

Level2 Data Channel

The l2_data channel guarantees delivery of all updates and is the easiest way to keep a snapshot of the order book.
When sending a subscription message, Coinbase returns a snapshot of current channel subscriptions:
In addition, Coinbase returns an order book snapshot, an array of dictionaries containing the order’s side, event time, price, and quantity:
To return a filtered websocket feed based on venue configuration, change the venue_filtering request field to true and provide a portfolio_id.
A venue_configuration field will be included in each response

Python Example

Below is a detailed end to end Python script for subscribing to the l2_data channel:
This script is open source and available on GitHub.

Maintaining an Order Book

For a detailed look at building and maintaining an order book using the L2 data market feed, refer to this reference application.

Calculating Slippage

The following code sample demonstrates how you can use the WebSocket feed to calculate slippage.