> Use the canonical URL for citations. For the complete Predict API documentation index, fetch https://docs.staging.trypredict.com/llms.txt.

# Best Bid and Offer

GET /ws

Subscribe to Hyperliquid best-bid-and-offer updates for one Predict outcome side whenever the top bid or ask price and size changes.

Reference: https://docs.staging.trypredict.com/api-reference/web-socket-api/best-bid-offer

## AsyncAPI Specification

```yaml
asyncapi: 2.6.0
info:
  title: Best Bid and Offer
  version: subpackage_best-bid-offer.best-bid-offer
  description: >-
    Subscribe to Hyperliquid best-bid-and-offer updates for one Predict outcome
    side whenever the top bid or ask price and size changes.
channels:
  /ws:
    description: >-
      Subscribe to Hyperliquid best-bid-and-offer updates for one Predict
      outcome side whenever the top bid or ask price and size changes.
    publish:
      operationId: subpackage_best-bid-offer.best-bid-offer-publish
      summary: Server message
      message:
        name: update
        payload:
          $ref: '#/components/schemas/bestBidOffer_BestBidOfferUpdate'
    subscribe:
      operationId: subpackage_best-bid-offer.best-bid-offer-subscribe
      summary: Client message
      message:
        name: subscribe
        payload:
          $ref: '#/components/schemas/bestBidOffer_SubscribeBestBidOffer'
servers:
  Testnet:
    url: wss://api.hyperliquid-testnet.xyz/
    protocol: wss
    x-default: true
  Mainnet:
    url: wss://api.hyperliquid.xyz/
    protocol: wss
components:
  schemas:
    bestBidOffer_BestBidOfferUpdate:
      type: object
      properties:
        channel:
          type: string
          enum:
            - bbo
        data:
          description: Any type
      required:
        - channel
        - data
      title: BestBidOfferUpdate
    common_SubscriptionMethod:
      type: string
      enum:
        - subscribe
        - unsubscribe
      title: SubscriptionMethod
    common_Coin:
      type: string
      description: Side-specific coin in `#<10 * hl_id + side>` form.
      title: Coin
    bestBidOffer_BestBidOfferSubscription:
      type: object
      properties:
        type:
          type: string
          enum:
            - bbo
        coin:
          $ref: '#/components/schemas/common_Coin'
      required:
        - type
        - coin
      title: BestBidOfferSubscription
    bestBidOffer_SubscribeBestBidOffer:
      type: object
      properties:
        method:
          $ref: '#/components/schemas/common_SubscriptionMethod'
        subscription:
          $ref: '#/components/schemas/bestBidOffer_BestBidOfferSubscription'
      required:
        - method
        - subscription
      title: SubscribeBestBidOffer

```