# bbo

## Subscribe to bbo

> Subscription to best bid and offer events for a specific asset.

```json
{"openapi":"3.1.1","info":{"title":"Hyperliquid Subscription - bbo","version":"1.0.0"},"tags":[{"name":"bbo"}],"servers":[{"url":"wss://api.hyperliquid.xyz/ws","description":"Mainnet WebSocket"},{"url":"wss://api.hyperliquid-testnet.xyz/ws","description":"Testnet WebSocket"}],"paths":{"/":{"post":{"tags":["bbo"],"summary":"Subscribe to bbo","description":"Subscription to best bid and offer events for a specific asset.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"description":"Type of subscription.","enum":["bbo"]},"coin":{"type":"string","description":"Asset symbol (e.g., BTC)."}},"required":["type","coin"],"description":"Subscription to best bid and offer events for a specific asset."}}},"required":true},"responses":{"200":{"description":"Event of best bid and offer.","content":{"application/json":{"schema":{"type":"object","properties":{"coin":{"type":"string","description":"Asset symbol (e.g., BTC)."},"time":{"type":"integer","minimum":0,"description":"Time of the BBO update (in ms since epoch)."},"bbo":{"type":"array","items":[{"type":"object","properties":{"px":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$","description":"Price."},"sz":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$","description":"Total size."},"n":{"type":"integer","minimum":0,"description":"Number of individual orders."}},"required":["px","sz","n"],"description":"L2 order book level."},{"type":"object","properties":{"px":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$","description":"Price."},"sz":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$","description":"Total size."},"n":{"type":"integer","minimum":0,"description":"Number of individual orders."}},"required":["px","sz","n"],"description":"L2 order book level."}],"minItems":2,"description":"Best bid and offer tuple [bid, offer], either can be undefined if unavailable."}},"required":["coin","time","bbo"],"description":"Event of best bid and offer."}}}}}}}}}
```
