> ## 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.

# Frontend Context

> Frontend Context 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.

Aggregated market context for all symbols. Ideal for dashboard views.

```json Subscribe theme={null}
{
  "method": "subscribe",
  "subscription": [{
    "type": "frontendContext"
  }]
}
```

```json Response theme={null}
{
  "type": "subscriptionResponse",
  "topics": ["frontendContext"]
}
```

```json Update theme={null}
{
  "type": "frontendContext",
  "data": {
    "ctx": [
      {
        "symbol": "BTC-USD",
        "volume": 1234.56,
        "funding": 0.0001,
        "oi": 5432.1,
        "lastPrice": 102777.5,
        "priceChange": 2777.5,
        "priceChangePercent": 2.77
      },
      {
        "symbol": "ETH-USD",
        "volume": 5678.90,
        "funding": 0.00015,
        "oi": 12345.6,
        "lastPrice": 3500.0,
        "priceChange": 150.0,
        "priceChangePercent": 4.48
      }
    ]
  },
  "topic": "frontendContext"
}
```

**Initial Response**: Latest cached ticker data for all symbols

**Updates**: Every 2 seconds

**Context Fields**:

| Field | Description |
| - | - |
| `symbol` | Market symbol |
| `volume` | 24h trading volume (base currency) |
| `funding` | Current funding rate |
| `oi` | One-sided ticker open interest (base currency) |
| `lastPrice` | Last traded price |
| `priceChange` | 24h price change (absolute) |
| `priceChangePercent` | 24h price change (percentage) |

## 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 frontend-context
id: frontend-context
title: Frontend context
description: >-
  Cached aggregate ticker context then periodic updates for all markets.
  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: frontend-contextSubscribe
    title: Frontend context subscribe
    type: receive
    messages:
      - &ref_3
        id: subscribe
        contentType: application/json
        payload:
          - name: Frontend context 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:
                      - frontendContext
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            method:
              type: string
              enum:
                - subscribe
              default: subscribe
              x-parser-schema-id: <anonymous-schema-287>
            subscription:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - frontendContext
                    default: frontendContext
                    x-parser-schema-id: <anonymous-schema-290>
                required:
                  - type
                x-parser-schema-id: <anonymous-schema-289>
              minItems: 1
              default:
                - type: frontendContext
              description: >-
                Playground example prefill. Send the subscription array
                explicitly; this is not a network-side default.
              x-parser-schema-id: <anonymous-schema-288>
          required:
            - method
            - subscription
          x-parser-schema-id: <anonymous-schema-286>
        title: Frontend context 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": "frontendContext"
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: frontend-context
  - &ref_2
    id: frontend-contextEvents
    title: Frontend context events
    type: send
    messages:
      - &ref_4
        id: frontendContext
        contentType: application/json
        payload:
          - name: Frontend context frontendContext
            description: Network-published frontendContext
            type: object
            properties:
              - name: type
                type: string
                enumValues:
                  - frontendContext
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: ctx
                    type: array
                    required: false
                    properties:
                      - name: symbol
                        type: string
                        required: false
                      - name: volume
                        type: number
                        required: false
                      - name: funding
                        type: number
                        required: false
                      - name: oi
                        type: number
                        required: false
                      - name: lastPrice
                        type: number
                        required: false
                      - name: priceChange
                        type: number
                        required: false
                      - name: priceChangePercent
                        type: number
                        required: false
              - name: topic
                type: string
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              enum:
                - frontendContext
              x-parser-schema-id: <anonymous-schema-292>
            data:
              type: object
              properties:
                ctx:
                  type: array
                  items:
                    type: object
                    properties:
                      symbol:
                        type: string
                        x-parser-schema-id: <anonymous-schema-296>
                      volume:
                        type: number
                        x-parser-schema-id: <anonymous-schema-297>
                      funding:
                        type: number
                        x-parser-schema-id: <anonymous-schema-298>
                      oi:
                        type: number
                        x-parser-schema-id: <anonymous-schema-299>
                      lastPrice:
                        type: number
                        x-parser-schema-id: <anonymous-schema-300>
                      priceChange:
                        type: number
                        x-parser-schema-id: <anonymous-schema-301>
                      priceChangePercent:
                        type: number
                        x-parser-schema-id: <anonymous-schema-302>
                    x-parser-schema-id: <anonymous-schema-295>
                  x-parser-schema-id: <anonymous-schema-294>
              x-parser-schema-id: <anonymous-schema-293>
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-303>
          required:
            - type
            - data
            - topic
          x-parser-schema-id: <anonymous-schema-291>
        title: Frontend context frontendContext
        description: Network-published frontendContext
        example: |-
          {
            "type": "frontendContext",
            "data": {
              "ctx": [
                {
                  "symbol": "BTC-USD",
                  "volume": 1234.56,
                  "funding": 0.0001,
                  "oi": 5432.1,
                  "lastPrice": 102777.5,
                  "priceChange": 2777.5,
                  "priceChangePercent": 2.77
                },
                {
                  "symbol": "ETH-USD",
                  "volume": 5678.9,
                  "funding": 0.00015,
                  "oi": 12345.6,
                  "lastPrice": 3500,
                  "priceChange": 150,
                  "priceChangePercent": 4.48
                }
              ]
            },
            "topic": "frontendContext"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: frontendContext
      - &ref_5
        id: subscribed
        contentType: application/json
        payload:
          - name: Frontend context 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-305>
            topics:
              type: array
              items:
                type: string
                x-parser-schema-id: <anonymous-schema-307>
              x-parser-schema-id: <anonymous-schema-306>
          required:
            - type
          x-parser-schema-id: <anonymous-schema-304>
        title: Frontend context subscribed
        example: |-
          {
            "type": "subscriptionResponse",
            "topics": [
              "frontendContext"
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribed
      - &ref_6
        id: unsubscribed
        contentType: application/json
        payload:
          - name: Frontend context 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-309>
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-310>
          required:
            - type
          x-parser-schema-id: <anonymous-schema-308>
        title: Frontend context unsubscribed
        example: |-
          {
            "type": "unsubscribeResponse",
            "topic": "frontendContext"
          }
        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: frontend-context
securitySchemes: []

````

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