Skip to content
Alchemy Logo

bbo stream

Beta

HyperCore APIs are in beta. Message fields, limits, and behavior may change, including breaking changes.

Best bid and best ask for each market, sent whenever the top of the book changes: price, size, or number of orders.

{
  "method": "subscribe",
  "subscriptionId": "bbo_01",
  "subscription": {
    "type": "bbo",
    "coins": [
      "BTC",
      "ETH"
    ]
  }
}

ParameterTypeRequiredDescription
coinsstring[]NoMarkets to include. The maximum per subscription depends on your plan; see limits. Omit for all markets (PAYG and Enterprise only).

{
  "channel": "subscriptionResponse",
  "subscriptionId": "bbo_01",
  "data": {
    "type": "bbo",
    "coins": [
      "BTC",
      "ETH"
    ]
  }
}

{
  "seq": 1,
  "channel": "bbo",
  "subscriptionId": "bbo_01",
  "data": {
    "blockNumber": 1183716828,
    "blockTime": 1791996538119,
    "isSnapshot": true,
    "books": [
      {
        "coin": "BTC",
        "bbo": [
          {
            "px": "81772.0",
            "sz": "30.29109",
            "n": 96
          },
          {
            "px": "81773.0",
            "sz": "0.02692",
            "n": 2
          }
        ]
      },
      {
        "coin": "ETH",
        "bbo": [
          {
            "px": "2442.5",
            "sz": "36.3142",
            "n": 7
          },
          {
            "px": "2442.6",
            "sz": "237.042",
            "n": 44
          }
        ]
      }
    ]
  }
}
FieldDescription
data.books[].bbo[bid, ask]. Either side can be null when that side of the book is empty.
px, sz, nPrice, total size at the level, and number of orders.

The first message includes every subscribed market, in alphabetical order; later messages include only markets whose top of book changed.

{"method":"unsubscribe","subscriptionId":"bbo_01"}

Book streams have no replay. After a disconnect, or if seq skips, resubscribe; the first message is a fresh snapshot. If you receive a book_reset error, drop local state for the subscription and rebuild from the snapshot that follows. See replay and recovery.

Was this page helpful?