> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bulk.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Candles

> Candles WebSocket subscription and response reference.

Connect to `wss://mainnet-ws1.bulk.trade`, then send the subscription below. All channels share the same socket; the page name is not a separate endpoint path. The playground sends read-only subscription messages.

Real-time candlestick data with historical backfill.

```json Subscribe theme={null}
{
  "method": "subscribe",
  "subscription": [{
    "type": "candle",
    "symbol": "BTC-USD",
    "interval": "1m"
  }]
}
```

```json Response theme={null}
{
  "type": "subscriptionResponse",
  "topics": ["candle.BTC-USD.1m"]
}
```

```json Update theme={null}
{
  "type": "candle",
  "data": {
    "candles": [
      {
        "t": 1699564800000,
        "T": 1699564860000,
        "o": 102000.0,
        "h": 102100.0,
        "l": 101900.0,
        "c": 101950.0,
        "v": 1.6,
        "n": 3
      }
    ]
  },
  "topic": "candle.BTC-USD.1m"
}
```

**Supported Intervals**: `10s`, `1m`, `3m`, `5m`, `15m`, `30m`, `1h`, `2h`, `4h`, `6h`, `8h`, `12h`, `1d`, `3d`, `1w`, `1M`

**Initial Response**: Up to 5000 historical candles

**Updates**: Published candle updates. Replace an existing candle with the same `t`; do not add its volume a second time. Publication depends on available market data and network endpoint processing.

**Candle Fields**:

| Field | Description |
| - | - |
| `t` | Open timestamp (milliseconds) |
| `T` | Close timestamp (milliseconds) |
| `o` | Open price |
| `h` | High price |
| `l` | Low price |
| `c` | Close price |
| `v` | Volume |
| `n` | Number of trades |

## Connection and Limits

See [connection management](https://docs.bulk.trade/api-reference/ws-connection.md) for reconnect behavior and [public rate limits](https://docs.bulk.trade/api-reference/rate-limits.md) for connection budgets.


## AsyncAPI

````yaml api-reference/asyncapi.yaml candles
id: candles
title: Candles
description: >-
  Initial backfill of up to 5000 candles, then updates. Replace matching open
  timestamp t; do not double-count volume. Connect, then send subscribe;
  unsubscribe uses the acknowledged topic. Unsubscribe using the acknowledged
  topic; see [Connection Management](/api-reference/ws-connection#unsubscribe).
servers:
  - id: mainnet
    protocol: wss
    host: mainnet-ws1.bulk.trade
    bindings: []
    variables: []
  - id: testnet
    protocol: wss
    host: exchange-ws1.bulk.trade
    bindings: []
    variables: []
address: /
parameters: []
bindings: []
operations:
  - &ref_1
    id: candlesSubscribe
    title: Candles subscribe
    type: receive
    messages:
      - &ref_3
        id: subscribe
        contentType: application/json
        payload:
          - name: Candles subscribe
            description: >-
              Schema defaults on this request are playground example prefills,
              not omitted-field defaults accepted by the network endpoint.
            type: object
            properties:
              - name: method
                type: string
                enumValues:
                  - subscribe
                required: true
              - name: subscription
                type: array
                description: >-
                  Playground example prefill. Send the subscription array
                  explicitly; this is not a network-side default.
                required: true
                properties:
                  - name: type
                    type: string
                    enumValues:
                      - candle
                    required: true
                  - name: symbol
                    type: string
                    description: Playground example prefill; not a network-side default.
                    required: true
                  - name: interval
                    type: string
                    description: Playground example prefill; not a network-side default.
                    enumValues:
                      - 10s
                      - 1m
                      - 3m
                      - 5m
                      - 15m
                      - 30m
                      - 1h
                      - 2h
                      - 4h
                      - 6h
                      - 8h
                      - 12h
                      - 1d
                      - 3d
                      - 1w
                      - 1M
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            method:
              type: string
              enum:
                - subscribe
              default: subscribe
              x-parser-schema-id: <anonymous-schema-40>
            subscription:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - candle
                    default: candle
                    x-parser-schema-id: <anonymous-schema-43>
                  symbol:
                    type: string
                    default: BTC-USD
                    description: Playground example prefill; not a network-side default.
                    x-parser-schema-id: <anonymous-schema-44>
                  interval:
                    type: string
                    enum:
                      - 10s
                      - 1m
                      - 3m
                      - 5m
                      - 15m
                      - 30m
                      - 1h
                      - 2h
                      - 4h
                      - 6h
                      - 8h
                      - 12h
                      - 1d
                      - 3d
                      - 1w
                      - 1M
                    default: 1m
                    description: Playground example prefill; not a network-side default.
                    x-parser-schema-id: <anonymous-schema-45>
                required:
                  - type
                  - symbol
                  - interval
                x-parser-schema-id: <anonymous-schema-42>
              minItems: 1
              default:
                - type: candle
                  symbol: BTC-USD
                  interval: 1m
              description: >-
                Playground example prefill. Send the subscription array
                explicitly; this is not a network-side default.
              x-parser-schema-id: <anonymous-schema-41>
          required:
            - method
            - subscription
          x-parser-schema-id: <anonymous-schema-39>
        title: Candles subscribe
        description: >-
          Schema defaults on this request are playground example prefills, not
          omitted-field defaults accepted by the network endpoint.
        example: |-
          {
            "method": "subscribe",
            "subscription": [
              {
                "type": "candle",
                "symbol": "BTC-USD",
                "interval": "1m"
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: candles
  - &ref_2
    id: candlesEvents
    title: Candles events
    type: send
    messages:
      - &ref_4
        id: candle
        contentType: application/json
        payload:
          - name: Candles candle
            description: Network-published candle
            type: object
            properties:
              - name: type
                type: string
                enumValues:
                  - candle
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: candles
                    type: array
                    required: false
                    properties:
                      - name: t
                        type: number
                        description: Unix timestamp in milliseconds.
                        required: false
                      - name: T
                        type: number
                        description: Unix timestamp in milliseconds.
                        required: false
                      - name: o
                        type: number
                        required: false
                      - name: h
                        type: number
                        required: false
                      - name: l
                        type: number
                        required: false
                      - name: c
                        type: number
                        required: false
                      - name: v
                        type: number
                        required: false
                      - name: 'n'
                        type: number
                        required: false
              - name: topic
                type: string
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              enum:
                - candle
              x-parser-schema-id: <anonymous-schema-47>
            data:
              type: object
              properties:
                candles:
                  type: array
                  items:
                    type: object
                    properties:
                      t:
                        type: number
                        description: Unix timestamp in milliseconds.
                        x-parser-schema-id: <anonymous-schema-51>
                      T:
                        type: number
                        description: Unix timestamp in milliseconds.
                        x-parser-schema-id: <anonymous-schema-52>
                      o:
                        type: number
                        x-parser-schema-id: <anonymous-schema-53>
                      h:
                        type: number
                        x-parser-schema-id: <anonymous-schema-54>
                      l:
                        type: number
                        x-parser-schema-id: <anonymous-schema-55>
                      c:
                        type: number
                        x-parser-schema-id: <anonymous-schema-56>
                      v:
                        type: number
                        x-parser-schema-id: <anonymous-schema-57>
                      'n':
                        type: number
                        x-parser-schema-id: <anonymous-schema-58>
                    x-parser-schema-id: <anonymous-schema-50>
                  x-parser-schema-id: <anonymous-schema-49>
              x-parser-schema-id: <anonymous-schema-48>
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-59>
          required:
            - type
            - data
            - topic
          x-parser-schema-id: <anonymous-schema-46>
        title: Candles candle
        description: Network-published candle
        example: |-
          {
            "type": "candle",
            "data": {
              "candles": [
                {
                  "t": 1699564800000,
                  "T": 1699564860000,
                  "o": 102000,
                  "h": 102100,
                  "l": 101900,
                  "c": 101950,
                  "v": 1.6,
                  "n": 3
                }
              ]
            },
            "topic": "candle.BTC-USD.1m"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: candle
      - &ref_5
        id: subscribed
        contentType: application/json
        payload:
          - name: Candles subscribed
            type: object
            properties:
              - name: type
                type: string
                enumValues:
                  - subscriptionResponse
                required: true
              - name: topics
                type: array
                required: false
                properties:
                  - name: item
                    type: string
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              enum:
                - subscriptionResponse
              x-parser-schema-id: <anonymous-schema-61>
            topics:
              type: array
              items:
                type: string
                x-parser-schema-id: <anonymous-schema-63>
              x-parser-schema-id: <anonymous-schema-62>
          required:
            - type
          x-parser-schema-id: <anonymous-schema-60>
        title: Candles subscribed
        example: |-
          {
            "type": "subscriptionResponse",
            "topics": [
              "candle.BTC-USD.1m"
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribed
      - &ref_6
        id: unsubscribed
        contentType: application/json
        payload:
          - name: Candles unsubscribed
            type: object
            properties:
              - name: type
                type: string
                enumValues:
                  - unsubscribeResponse
                required: true
              - name: topic
                type: string
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              enum:
                - unsubscribeResponse
              x-parser-schema-id: <anonymous-schema-65>
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-66>
          required:
            - type
          x-parser-schema-id: <anonymous-schema-64>
        title: Candles unsubscribed
        example: |-
          {
            "type": "unsubscribeResponse",
            "topic": "candle.BTC-USD.1m"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: unsubscribed
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
receiveOperations:
  - *ref_2
sendMessages:
  - *ref_3
receiveMessages:
  - *ref_4
  - *ref_5
  - *ref_6
extensions:
  - id: x-parser-unique-object-id
    value: candles
securitySchemes: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.