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

# Candles

GET /ws

Subscribe to live Hyperliquid OHLCV candles for one Predict outcome-side market and interval to update charts and time-series analytics.

Reference: https://docs.staging.trypredict.com/api-reference/web-socket-api/candles

## AsyncAPI Specification

```yaml
asyncapi: 2.6.0
info:
  title: Candles
  version: subpackage_candles.candles
  description: >-
    Subscribe to live Hyperliquid OHLCV candles for one Predict outcome-side
    market and interval to update charts and time-series analytics.
channels:
  /ws:
    description: >-
      Subscribe to live Hyperliquid OHLCV candles for one Predict outcome-side
      market and interval to update charts and time-series analytics.
    publish:
      operationId: subpackage_candles.candles-publish
      summary: Server message
      message:
        name: update
        payload:
          $ref: '#/components/schemas/candles_CandlesUpdate'
    subscribe:
      operationId: subpackage_candles.candles-subscribe
      summary: Client message
      message:
        name: subscribe
        payload:
          $ref: '#/components/schemas/candles_SubscribeCandles'
servers:
  Testnet:
    url: wss://api.hyperliquid-testnet.xyz/
    protocol: wss
    x-default: true
  Mainnet:
    url: wss://api.hyperliquid.xyz/
    protocol: wss
components:
  schemas:
    common_CandleInterval:
      type: string
      enum:
        - 1m
        - 3m
        - 5m
        - 15m
        - 30m
        - 1h
        - 2h
        - 4h
        - 8h
        - 12h
        - 1d
        - 3d
        - 1w
        - 1M
      title: CandleInterval
    common_Candle:
      type: object
      properties:
        t:
          type: integer
          format: int64
        T:
          type: integer
          format: int64
        s:
          type: string
        i:
          $ref: '#/components/schemas/common_CandleInterval'
        o:
          type: string
        c:
          type: string
        h:
          type: string
        l:
          type: string
        v:
          type: string
        'n':
          type: integer
      required:
        - t
        - T
        - s
        - i
        - o
        - c
        - h
        - l
        - v
        - 'n'
      title: Candle
    candles_CandlesUpdate:
      type: object
      properties:
        channel:
          type: string
          enum:
            - candle
        data:
          type: array
          items:
            $ref: '#/components/schemas/common_Candle'
      required:
        - channel
        - data
      title: CandlesUpdate
    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
    candles_CandlesSubscription:
      type: object
      properties:
        type:
          type: string
          enum:
            - candle
        coin:
          $ref: '#/components/schemas/common_Coin'
        interval:
          $ref: '#/components/schemas/common_CandleInterval'
      required:
        - type
        - coin
        - interval
      title: CandlesSubscription
    candles_SubscribeCandles:
      type: object
      properties:
        method:
          $ref: '#/components/schemas/common_SubscriptionMethod'
        subscription:
          $ref: '#/components/schemas/candles_CandlesSubscription'
      required:
        - method
        - subscription
      title: SubscribeCandles

```