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

# WebSocket Stream (Documentation Only)

> Real-time market data streaming via WebSocket with channel subscriptions.

## Connection
```http
wss://api.hyperprop.com/md/ws/stream?token=JWT_TOKEN
```

## Available Channels
- `ticker` - Real-time trade prices
- `ohlc` - Real-time OHLC/candlestick bars
- `orderbook` - Best bid/ask updates
- `level2` - Level 2 depth (top 10 levels)

## Client Messages (send to server)

### Subscribe to a channel
```json
{
"action": "subscribe",
"channel": "ticker",
"symbols": ["ES", "NQ"]
}
```

### Unsubscribe from a channel
```json
{ "action": "unsubscribe", "channel": "ticker" }
```

### Ping (keepalive)
```json
{ "action": "ping" }
```

## Server Messages

### Welcome (on connect)
```json
{
"type": "Welcome",
"message": "Connected to Hyperprop Market Data WebSocket",
"authenticated": true,
"user_id": "uuid",
"available_channels": ["ticker", "ohlc", "orderbook", "level2"],
"entitlements": { "products": ["CME", "NYMEX"], "user_type": "non_professional" }
}
```

### Subscribed (confirmation)
```json
{ "type": "Subscribed", "channel": "ticker", "symbols": ["ES", "NQ"] }
```

### Price (ticker channel)
```json
{
"type": "Price",
"channel": "ticker",
"data": { "symbol": "ES", "contract": "ESH6", "price": 6010250000000, "size": 5, "side": "B" }
}
```

### Bar (ohlc channel)
```json
{
"type": "Bar",
"channel": "ohlc",
"data": { "symbol": "ES", "contract": "ESH6", "open": 6010000000000, "high": 6012500000000, "low": 6008750000000, "close": 6011250000000, "volume": 1234, "interval": 60 }
}
```

### Pong (response to ping)
```json
{ "type": "Pong", "timestamp": 1705123456000 }
```

### Error
```json
{ "type": "Error", "message": "Authentication required", "code": "AUTH_REQUIRED" }
```

## Error Codes
| Code | Description |
|------|-------------|
| `AUTH_REQUIRED` | No JWT token or invalid token |
| `ENTITLEMENT_DENIED` | User not entitled to CME data |
| `INVALID_CHANNEL` | Unknown channel name |



## OpenAPI

````yaml /api-reference/md-openapi.json get /md/ws/stream
openapi: 3.0.3
info:
  contact:
    name: Hyperprop
    url: https://hyperprop.com
  description: >-
    # Hyperprop Market Data API


    Real-time futures market data streaming.


    ## Overview


    - **REST endpoints** for current ticker prices, OHLC, order books

    - **WebSocket** for real-time streaming with channel subscriptions

    - **JWT authentication** + CME entitlements


    ## Price Format


    Prices are **raw fixed-point integer values** (i64):

    ```text

    displayPrice = rawPrice / 1_000_000_000

    // 6010250000000 → $6010.25

    ```


    ## Authentication


    All WebSocket connections require a JWT token:

    ```http

    wss://api.hyperprop.com/md/ws/stream?token=YOUR_JWT_TOKEN

    ```


    ## CME Entitlements


    Access requires an accepted CME market data agreement and an active
    entitlement for the requested product.


    | Exchange | Symbols |

    |----------|---------|

    | CME | ES, NQ, RTY |

    | CBOT | ZC, ZS, ZW, ZB, ZN |

    | NYMEX | CL, NG, RB |

    | COMEX | GC, SI, HG |


    ## WebSocket Usage


    Connect to `/md/ws/stream` and subscribe to channels:


    ```javascript

    const ws = new
    WebSocket('wss://api.hyperprop.com/md/ws/stream?token=JWT_TOKEN');


    ws.onopen = () => {
      // Subscribe to ticker channel
      ws.send(JSON.stringify({
        action: 'subscribe',
        channel: 'ticker',
        symbols: ['ES', 'NQ']
      }));
    };


    ws.onmessage = (e) => {
      const msg = JSON.parse(e.data);
      if (msg.type === 'Price') {
        console.log(`${msg.data.symbol}: $${(msg.data.price / 1e9).toFixed(2)}`);
      }
    };

    ```
  license:
    name: Proprietary
  title: Hyperprop Market Data API
  version: 0.1.0
servers:
  - url: https://api.hyperprop.com
    description: Production
security: []
tags:
  - description: Health checks and server information
    name: System
  - description: Current ticker prices
    name: Tickers
  - description: OHLC candlestick data
    name: OHLC
  - description: Best bid/ask prices (top of book)
    name: Order Book
  - description: Historical market data (OHLC bars)
    name: Historical
  - description: Real-time streaming via WebSocket
    name: WebSocket
paths:
  /md/ws/stream:
    get:
      tags:
        - WebSocket
      summary: WebSocket Stream (Documentation Only)
      description: >-
        Real-time market data streaming via WebSocket with channel
        subscriptions.


        ## Connection

        ```http

        wss://api.hyperprop.com/md/ws/stream?token=JWT_TOKEN

        ```


        ## Available Channels

        - `ticker` - Real-time trade prices

        - `ohlc` - Real-time OHLC/candlestick bars

        - `orderbook` - Best bid/ask updates

        - `level2` - Level 2 depth (top 10 levels)


        ## Client Messages (send to server)


        ### Subscribe to a channel

        ```json

        {

        "action": "subscribe",

        "channel": "ticker",

        "symbols": ["ES", "NQ"]

        }

        ```


        ### Unsubscribe from a channel

        ```json

        { "action": "unsubscribe", "channel": "ticker" }

        ```


        ### Ping (keepalive)

        ```json

        { "action": "ping" }

        ```


        ## Server Messages


        ### Welcome (on connect)

        ```json

        {

        "type": "Welcome",

        "message": "Connected to Hyperprop Market Data WebSocket",

        "authenticated": true,

        "user_id": "uuid",

        "available_channels": ["ticker", "ohlc", "orderbook", "level2"],

        "entitlements": { "products": ["CME", "NYMEX"], "user_type":
        "non_professional" }

        }

        ```


        ### Subscribed (confirmation)

        ```json

        { "type": "Subscribed", "channel": "ticker", "symbols": ["ES", "NQ"] }

        ```


        ### Price (ticker channel)

        ```json

        {

        "type": "Price",

        "channel": "ticker",

        "data": { "symbol": "ES", "contract": "ESH6", "price": 6010250000000,
        "size": 5, "side": "B" }

        }

        ```


        ### Bar (ohlc channel)

        ```json

        {

        "type": "Bar",

        "channel": "ohlc",

        "data": { "symbol": "ES", "contract": "ESH6", "open": 6010000000000,
        "high": 6012500000000, "low": 6008750000000, "close": 6011250000000,
        "volume": 1234, "interval": 60 }

        }

        ```


        ### Pong (response to ping)

        ```json

        { "type": "Pong", "timestamp": 1705123456000 }

        ```


        ### Error

        ```json

        { "type": "Error", "message": "Authentication required", "code":
        "AUTH_REQUIRED" }

        ```


        ## Error Codes

        | Code | Description |

        |------|-------------|

        | `AUTH_REQUIRED` | No JWT token or invalid token |

        | `ENTITLEMENT_DENIED` | User not entitled to CME data |

        | `INVALID_CHANNEL` | Unknown channel name |
      operationId: wsStream
      parameters:
        - description: JWT authentication token
          in: query
          name: token
          required: true
          schema:
            type: string
      responses:
        '101':
          description: WebSocket upgrade successful
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication required
components:
  schemas:
    ErrorResponse:
      description: Error response
      example:
        code: AUTH_REQUIRED
        error: Unauthorized
        message: Valid JWT token required
      properties:
        code:
          description: Error code for programmatic handling
          type: string
        error:
          description: Error type
          type: string
        message:
          description: Human-readable error message
          type: string
      required:
        - error
        - code
        - message
      type: object

````

## Related topics

- [Real-time event stream (WebSocket)](/platform-api/organization/real-time-event-stream-websocket.md)
- [Rate limits & quotas](/concepts/rate-limits.md)
- [Real-time WebSocket for trading events](/trade-api/websocket/real-time-websocket-for-trading-events.md)
- [Partner integrations](/guides/partner-integrations.md)
- [Introduction](/introduction.md)
