Skip to main content
WSS
/
v1
/
market
/
ws

Documentation Index

Fetch the complete documentation index at: https://finance.dev/llms.txt

Use this file to discover all available pages before exploring further.

Key Features

Field-Level Subscriptions

Choose specific quote/trade fields or use wildcard * for all fields. Minimize bandwidth by requesting only the data you need.

Real-Time Updates

NDJSON message framing for optimal performance with millisecond-level latency.

Initial Snapshot

Get the current market state when you subscribe.

Multi-Symbol Support

Subscribe to multiple symbols in a single request for efficient batch subscriptions.

Equities & Options

Stream real-time data for stocks and option contracts using OSI symbols.

Market Indices

Track major indices including SPX, NDX, DJI, VIX, and more in real-time.

Equities

Standard stock ticker symbols (e.g., AAPL, MSFT, GOOGL, TSLA).

Indices

Major market indices are supported: SPX (S&P 500), NDX (Nasdaq 100), DJI (Dow Jones), VIX (Volatility Index), RUT (Russell 2000), COMP (Nasdaq Composite), NYA (NYSE Composite), OEX (S&P 100), MID (S&P MidCap 400), SML (S&P SmallCap 600).
Index symbols do not have bid/ask quote data. When subscribing to indices, use trade fields (lastPrice, openPrice, highPrice, lowPrice, etc.).

Options

Option contracts use OSI (Options Symbology Initiative) symbols (e.g., AAPL240119C00150000 for AAPL Jan 19 2024 $150 Call).When subscribing to options, set symbolType: "option" in your subscription request.

Quote Data

Real-time bid/ask prices from the consolidated order book (NBBO - National Best Bid and Offer).

Trade Data

Last sale information, volume, and OHLC (Open-High-Low-Close) prices.

Level 2 / Order Book Data

Market depth showing quotes from multiple exchanges. Provides insight into supply and demand at different price levels across all market makers and exchanges.

Time & Sales Data

Real-time trade execution feed showing every trade as it happens, including price, size, timestamp, and exchange. Essential for tape reading and order flow analysis.

Greeks Data

Option Greeks (delta, gamma, theta, vega, rho) and implied volatility for option contracts. Delivers a last-known snapshot on subscribe, then streams real-time updates. Only available when symbolType: "option" and greeksFields is specified.

Market Status

Current market session state, exchange statuses, and pre-market or after-hours flags.
Level 2 data does not provide an initial snapshot - you will receive updates as they arrive from the market feed. Greeks data does provide an initial snapshot of the last known values upon subscribing.
Level 2 updates are forwarded from the market feed as compact string arrays. payload.data.orderBook entries use askSize:price:bidSize, and payload.data.quotes entries use exchange:askPrice:askSize:bidPrice:bidSize.Example:
{
  "orderBook": ["0:250.00:100", "100:272.55:0"],
  "quotes": ["EDGX:272.55:100:272.00:500"],
  "symbol": "AAPL",
  "timestamp": "2025-12-29T05:18:33.600000-05:00"
}
For performance optimization, the server may coalesce multiple messages into a single WebSocket frame, separated by newline characters (\n). This is known as Newline-Delimited JSON (NDJSON).Clients MUST handle this by splitting incoming WebSocket frames on newline characters and parsing each line as a separate JSON message.

Example

A single WebSocket frame may contain:
{"type":"event","payload":{"action":"snapshot","type":"quote","symbol":"MSFT","data":{"bidPrice":189.94},"id":"sub-1","timestamp":1701450000123}}
{"type":"event","payload":{"action":"snapshot","type":"quote","symbol":"AAPL","data":{"bidPrice":172.21},"id":"sub-1","timestamp":1701450000124}}
Clients should split on \n and parse each line independently.

WebSocket Client

Library that supports WSS protocol for secure WebSocket connections.

Authentication

Valid authentication token (if required by your environment).

JSON Parser

NDJSON message format handling capability for parsing streaming data.

Network Connectivity

Stable network connection to the WebSocket endpoint.

Portfolio Monitoring

Live price updates, bid/ask spreads, and intraday performance tracking for your holdings.

Trading Applications

Real-time market prices for order entry systems and trade execution platforms.

Market Dashboards

Display market trends and index movements (SPX, NDX, VIX) on your analytics dashboard.

Price Alert Systems

Trigger notifications on price thresholds, volume spikes, or custom market conditions.

Market Analysis Tools

Real-time data feeds for technical analysis and market research applications.

Authentication

If authentication is enabled, authenticate after opening the WebSocket and before subscribing. Auth uses the request/response envelope with POST /auth; the body is only the token object expected by the backend. Client sends:
{
  "type": "request",
  "id": "auth-001",
  "payload": {
    "method": "POST",
    "path": "/auth",
    "body": {
      "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
    }
  }
}
Server responds:
{
  "type": "event",
  "payload": {
    "action": "authSuccess",
    "id": "auth-001",
    "data": {
      "expiresIn": 2700000
    },
    "timestamp": 1701450000123
  }
}

Subscribing to Market Data

Basic Subscription Structure

All subscription requests use the shared WebSocket envelope. The payload value is an array of symbol subscription objects.
{
  "type": "subscribe",
  "id": "optional-correlation-id",
  "payload": [
    {
      "symbol": "AAPL",
      "symbolType": "equity",
      "quoteFields": ["bidPrice", "askPrice"],
      "tradeFields": ["lastPrice", "totalVolume"],
      "level2": false,
      "timeAndSales": false,
      "timeAndSalesFields": ["price", "size"],
      "greeksFields": ["delta", "gamma"]
    }
  ]
}
symbolType defaults to equity. If quoteFields and tradeFields are both omitted, the backend subscribes to all quote and all trade fields for that symbol. Field lists (fields, quoteFields, tradeFields, timeAndSalesFields, greeksFields) accept either a string or an array of strings; arrays are recommended.

Subscription Examples

Subscribe to Trade Fields Only

Get just price and size data for AAPL:
{
  "type": "subscribe",
  "id": "sub-1",
  "payload": [
    {
      "symbol": "AAPL",
      "tradeFields": ["price", "size"]
    }
  ]
}

Subscribe to All Quote and Trade Fields

When both quoteFields and tradeFields are omitted, the backend subscribes to all quote and all trade fields:
{
  "type": "subscribe",
  "id": "sub-2",
  "payload": [
    {
      "symbol": "AAPL"
    }
  ]
}

Subscribe to Quote Fields Only

Include only quoteFields when you do not want a trade subscription:
{
  "type": "subscribe",
  "id": "sub-quote-1",
  "payload": [
    {
      "symbol": "AAPL",
      "quoteFields": ["bidPrice", "askPrice", "bidSize", "askSize"]
    }
  ]
}

Subscribe to All Fields Using Wildcard

Use "*" to subscribe to all available fields:
{
  "type": "subscribe",
  "id": "sub-4",
  "payload": [
    {
      "symbol": "GOOGL",
      "quoteFields": ["*"],
      "tradeFields": ["*"]
    }
  ]
}

Subscribe to Specific Quote Fields for Multiple Symbols

{
  "type": "subscribe",
  "id": "sub-3",
  "payload": [
    {
      "symbol": "AAPL",
      "quoteFields": ["bidPrice", "bidSize", "askPrice", "askSize", "midPrice", "spread"]
    },
    {
      "symbol": "MSFT",
      "quoteFields": ["bidPrice", "bidSize", "askPrice", "askSize", "midPrice", "spread"]
    }
  ]
}

Subscribe to Multiple Symbols with Different Fields

Different symbols can have different field subscriptions:
{
  "type": "subscribe",
  "id": "sub-6",
  "payload": [
    {
      "symbol": "AAPL",
      "tradeFields": ["lastPrice", "size", "netChange", "tick"]
    },
    {
      "symbol": "MSFT",
      "quoteFields": ["bidPrice", "askPrice", "spread"]
    },
    {
      "symbol": "GOOGL",
      "quoteFields": ["*"],
      "tradeFields": ["*"]
    }
  ]
}

Subscribe to Level 2 Order Book Data

{
  "type": "subscribe",
  "id": "sub-l2-1",
  "payload": [
    {
      "symbol": "AAPL",
      "level2": true
    }
  ]
}

Subscribe to Time & Sales Data

{
  "type": "subscribe",
  "id": "sub-tns-1",
  "payload": [
    {
      "symbol": "AAPL",
      "timeAndSales": true
    }
  ]
}

Subscribe to Both Level 2 and Time & Sales

Perfect for tape reading and order flow analysis:
{
  "type": "subscribe",
  "id": "sub-l2-tns-1",
  "payload": [
    {
      "symbol": "AAPL",
      "level2": true,
      "timeAndSales": true
    }
  ]
}

Full Market Data Suite

Subscribe to quotes, trades, Level 2, and Time & Sales:
{
  "type": "subscribe",
  "id": "sub-full-1",
  "payload": [
    {
      "symbol": "AAPL",
      "quoteFields": ["bidPrice", "askPrice", "midPrice", "spread"],
      "tradeFields": ["lastPrice", "size", "totalVolume", "netChange"],
      "level2": true,
      "timeAndSales": true
    }
  ]
}

Subscribe to S&P 500 Index

Indices do not have bid/ask quote data. Use tradeFields only.
{
  "type": "subscribe",
  "id": "sub-7",
  "payload": [
    {
      "symbol": "SPX",
      "tradeFields": ["lastPrice", "openPrice", "highPrice", "lowPrice", "netChange", "totalVolume"]
    }
  ]
}

Subscribe to Multiple Indices

{
  "type": "subscribe",
  "id": "sub-8",
  "payload": [
    {
      "symbol": "SPX",
      "tradeFields": ["lastPrice", "netChange"]
    },
    {
      "symbol": "NDX",
      "tradeFields": ["lastPrice", "netChange"]
    },
    {
      "symbol": "VIX",
      "tradeFields": ["lastPrice", "netChange"]
    }
  ]
}

Mixed Equities and Indices

{
  "type": "subscribe",
  "id": "sub-9",
  "payload": [
    {
      "symbol": "AAPL",
      "quoteFields": ["bidPrice", "askPrice", "midPrice"],
      "tradeFields": ["lastPrice", "netChange"]
    },
    {
      "symbol": "SPX",
      "tradeFields": ["lastPrice", "openPrice", "highPrice", "lowPrice"]
    }
  ]
}

Subscribe to a Single Option Contract

Options use OSI (Options Symbology Initiative) symbols. You must set symbolType: "option".
{
  "type": "subscribe",
  "id": "sub-10",
  "payload": [
    {
      "symbol": "AAPL240119C00150000",
      "symbolType": "option",
      "quoteFields": ["bidPrice", "askPrice", "midPrice", "spread", "openInterest"],
      "tradeFields": ["lastPrice", "totalVolume"]
    }
  ]
}

Subscribe to Multiple Option Contracts

{
  "type": "subscribe",
  "id": "sub-11",
  "payload": [
    {
      "symbol": "AAPL240119C00150000",
      "symbolType": "option",
      "quoteFields": ["bidPrice", "askPrice"],
      "tradeFields": ["lastPrice"]
    },
    {
      "symbol": "AAPL240119C00155000",
      "symbolType": "option",
      "quoteFields": ["bidPrice", "askPrice"],
      "tradeFields": ["lastPrice"]
    },
    {
      "symbol": "AAPL240119P00145000",
      "symbolType": "option",
      "quoteFields": ["bidPrice", "askPrice"],
      "tradeFields": ["lastPrice"]
    }
  ]
}

Subscribe to All Greeks (Wildcard)

Use "*" to receive all Greeks fields for an option contract:
{
  "type": "subscribe",
  "id": "sub-greeks-1",
  "payload": [
    {
      "symbol": "XSP281215C00920000",
      "symbolType": "option",
      "greeksFields": ["*"]
    }
  ]
}

Subscribe to Specific Greeks Fields

Request only the Greeks you need to minimize bandwidth:
{
  "type": "subscribe",
  "id": "sub-greeks-2",
  "payload": [
    {
      "symbol": "AAPL240119C00150000",
      "symbolType": "option",
      "greeksFields": ["delta", "impliedVolatility"]
    }
  ]
}

Subscribe to Greeks Alongside Quotes

Combine Greeks with quote data in a single subscription:
{
  "type": "subscribe",
  "id": "sub-greeks-3",
  "payload": [
    {
      "symbol": "AAPL240119C00150000",
      "symbolType": "option",
      "quoteFields": ["bidPrice", "askPrice", "midPrice"],
      "greeksFields": ["delta", "gamma", "theta", "vega", "impliedVolatility"]
    }
  ]
}
greeksFields is only applicable when symbolType is "option". Including it for equity symbols has no effect.

Available Fields Reference

Frequently used fields you can subscribe to, organized by data type. The wildcard ["*"] expands to every backend-supported field for that category.

Quote Fields

Subscribe to these fields using the quoteFields array. Use ["*"] for all fields.
FieldDescription
*Wildcard - Subscribe to all available quote fields
bidPriceCurrent best bid price - the highest price a buyer is willing to pay
bidChangeChange in bid price from the previous quote update
bidSizeNumber of shares available at the bid price (typically in round lots of 100)
bidSizeChangeChange in bid size from the previous quote update
bidTimestampUnix timestamp in milliseconds when the bid was last updated
bidExchangeExchange code where the best bid originated (e.g., ‘Q’ for NASDAQ, ‘N’ for NYSE)
askPriceCurrent best ask (offer) price - the lowest price a seller is willing to accept
askChangeChange in ask price from the previous quote update
askSizeNumber of shares available at the ask price (typically in round lots of 100)
askSizeChangeChange in ask size from the previous quote update
askTimestampUnix timestamp in milliseconds when the ask was last updated
askExchangeExchange code where the best ask originated (e.g., ‘Q’ for NASDAQ, ‘N’ for NYSE)
quoteTimestampUnix timestamp in milliseconds of the consolidated/top-of-book quote time
midPriceMidpoint price calculated as (bidPrice + askPrice) / 2
spreadBid-ask spread calculated as askPrice - bidPrice
openInterestTotal outstanding open contracts for the option (options only; include in quoteFields when symbolType is "option")
Example:
"quoteFields": ["bidPrice", "askPrice", "bidSize", "askSize", "midPrice", "spread"]
Subscribe to these fields using the tradeFields array. Use ["*"] for all fields.
FieldDescription
*Wildcard - Subscribe to all available trade fields
priceLast trade execution price (same as lastPrice in most cases)
sizeNumber of shares in the last trade execution
totalVolumeCumulative trading volume for the current session (total shares traded)
tickVolumeVolume of shares traded in the most recent tick/update
openPriceOpening price for the current trading session
highPriceHighest price reached during the current trading session
lowPriceLowest price reached during the current trading session
lastPriceMost recent trade price (last sale price)
netChangeNet price change from previous close (lastPrice - previousClosePrice)
tickTick direction indicator: ‘up’ (uptick), ‘down’ (downtick), or ‘unchanged’
tradeSeqTrade sequence number - monotonically increasing identifier for each trade
tradeTimestampISO 8601 timestamp of when the trade was executed
closePriceOfficial closing price (may be from current or previous session depending on market hours)
previousClosePricePrevious trading session’s official closing price, used to calculate netChange
Example:
"tradeFields": ["lastPrice", "size", "totalVolume", "netChange", "tick"]
For Indices: Use trade fields only. Indices do not have bid/ask quote data.
Subscribe to these fields using the timeAndSalesFields array when timeAndSales: true. Use ["*"] for all fields (default if not specified).
FieldDescription
*Wildcard - Subscribe to all available Time & Sales fields
symbolThe ticker symbol for the trade
priceTrade execution price
sizeNumber of shares in the trade
tickTick direction indicator: ‘up’ (uptick), ‘down’ (downtick), or ‘unchanged’
tradeSeqTrade sequence number - monotonically increasing identifier for each trade
tradeExchangeExchange code where the trade was executed (e.g., ‘Q’ for NASDAQ, ‘N’ for NYSE, ‘D’ for FINRA ADF)
tradeTimestampISO 8601 timestamp of when the trade was executed
Example:
{
  "symbol": "AAPL",
  "timeAndSales": true,
  "timeAndSalesFields": ["price", "size", "tick", "tradeTimestamp", "tradeExchange"]
}
Time & Sales shows every individual trade execution in real-time. Essential for tape reading and order flow analysis.
Level 2 data is enabled with level2: true. The response contains market depth across multiple exchanges in a compact format.
FieldDescription
symbolThe ticker symbol for the order book
orderBookArray of compact order book entries in format "askSize:price:bidSize"
quotesArray of exchange quotes in format "EXCHANGE:askPrice:askSize:bidPrice:bidSize"
timestampISO 8601 timestamp of the update
Order Book Format: Each entry in orderBook follows: "askSize:price:bidSize"
  • askSize: Number of shares at ask (0 if no ask)
  • price: Price level
  • bidSize: Number of shares at bid (0 if no bid)
Quotes Format: Each entry in quotes follows: "EXCHANGE:askPrice:askSize:bidPrice:bidSize"
  • EXCHANGE: Exchange code (NSDQ, NYSE, BATS, EDGX, etc.)
  • askPrice: Ask price at this exchange
  • askSize: Number of shares at ask
  • bidPrice: Bid price at this exchange
  • bidSize: Number of shares at bid
Example Response:
Format Guide:
  • orderBook: askSize:price:bidSize (e.g., "0:250.00:100" = 0 shares ask, $250.00 price, 100 shares bid)
  • quotes: exchange:askPrice:askSize:bidPrice:bidSize (e.g., "EDGX:272.55:100:272.00:500" = EDGX exchange, 272.55askwith100shares,272.55 ask with 100 shares, 272.00 bid with 500 shares)
{
  "type": "event",
  "payload": {
    "action": "update",
    "type": "level2nOB",
    "symbol": "AAPL",
    "data": {
      "orderBook": [
        "0:250.00:100",
        "0:271.00:100",
        "0:272.00:1000",
        "45:272.49:0",
        "100:272.55:0"
      ],
      "quotes": [
        "EDGX:272.55:100:272.00:500",
        "BATS:272.58:300:271.00:100",
        "NSDQ:272.49:45:272.40:10"
      ],
      "symbol": "AAPL",
      "timestamp": "2025-12-29T05:18:33.600000-05:00"
    },
    "timestamp": 1767003513653
  }
}
No Initial Snapshot: Level 2 data does not provide an initial snapshot. You will receive updates as they arrive from the market feed.
Subscribe to these fields using the greeksFields array. Only available for option contracts (symbolType: "option"). Use ["*"] for all fields.
FieldDescription
*Wildcard - Subscribe to all available Greeks fields
deltaRate of change of option price per $1 move in the underlying. Ranges 0 to 1 for calls, -1 to 0 for puts
gammaRate of change of delta per $1 move in the underlying. Measures curvature of option value
thetaDaily time decay of the option price. Typically negative
vegaRate of change of option price per 1% change in implied volatility
rhoRate of change of option price per 1% change in the risk-free interest rate
impliedVolatilityMarket-implied volatility as a decimal (e.g., 0.2752 = 27.52%)
symbolThe OSI symbol of the option contract
timestampISO 8601 timestamp of when the Greeks were last calculated
Example (all Greeks):
"greeksFields": ["*"]
Example (selective fields):
"greeksFields": ["delta", "gamma", "impliedVolatility"]
greeksFields is only applicable when symbolType is "option". It has no effect for equity or index symbols.

Unsubscribing from Market Data

The WebSocket supports three unsubscribe modes for flexible subscription management.
Remove all subscriptions for one or more symbols:
{
  "type": "unsubscribe",
  "id": "unsub-1",
  "payload": ["AAPL", "MSFT", "GOOGL"]
}
This removes all quote, trade, Level 2, Time & Sales, and Greeks subscriptions for the specified symbols.

Unsubscribe Response

When you unsubscribe, the server confirms the action:
{
  "type": "event",
  "payload": {
    "action": "unsubscribe",
    "data": {
      "symbols": ["AAPL"]
    },
    "id": "unsub-1",
    "timestamp": 1701450000123
  }
}

Message Formats & Responses

Snapshot Responses

When you subscribe, you immediately receive a snapshot of current market data. The snapshot contains all requested fields.

Quote Snapshot Example

{
  "type": "event",
  "payload": {
    "action": "snapshot",
    "type": "quote",
    "symbol": "AAPL",
    "data": {
      "bidPrice": 150.25,
      "bidSize": 500,
      "bidChange": 0.05,
      "bidSizeChange": 100,
      "bidTimestamp": 1701450000120,
      "bidExchange": "Q",
      "askPrice": 150.26,
      "askSize": 300,
      "askChange": 0.03,
      "askSizeChange": -50,
      "askTimestamp": 1701450000121,
      "askExchange": "N",
      "quoteTimestamp": 1701450000121,
      "midPrice": 150.255,
      "spread": 0.01
    },
    "id": "sub-1",
    "timestamp": 1701450000123
  }
}
{
  "type": "event",
  "payload": {
    "action": "snapshot",
    "type": "trade",
    "symbol": "AAPL",
    "data": {
      "price": 150.25,
      "lastPrice": 150.25,
      "size": 100,
      "totalVolume": 45678900,
      "tickVolume": 100,
      "openPrice": 149.50,
      "highPrice": 151.00,
      "lowPrice": 149.25,
      "closePrice": 149.80,
      "previousClosePrice": 149.80,
      "netChange": 0.45,
      "tick": "up",
      "tradeSeq": 123456,
      "tradeTimestamp": "2026-04-20T07:11:01.123000-04:00"
    },
    "id": "sub-1",
    "timestamp": 1701450000125
  }
}
Level 2 does not send an initial snapshot. You receive updates as they arrive.
Format Guide:
  • orderBook: askSize:price:bidSize
  • quotes: exchange:askPrice:askSize:bidPrice:bidSize
{
  "type": "event",
  "payload": {
    "action": "update",
    "type": "level2nOB",
    "symbol": "AAPL",
    "timestamp": 1701450000123,
    "data": {
      "orderBook": [
        "0:150.24:200",
        "0:150.24:300",
        "500:150.26:0",
        "300:150.26:0",
        "400:150.27:0"
      ],
      "quotes": [
        "NSDQ:150.26:500:150.25:400",
        "NYSE:150.27:200:150.24:200",
        "PACF:150.26:300:150.24:300"
      ],
      "symbol": "AAPL",
      "timestamp": "2025-12-29T05:18:33.123000-05:00"
    }
  }
}
{
  "type": "event",
  "payload": {
    "action": "update",
    "type": "timeAndSales",
    "symbol": "AAPL",
    "timestamp": 1701450000458,
    "data": {
      "symbol": "AAPL",
      "price": "150.26",
      "size": "250",
      "tick": "up",
      "tradeSeq": "123457",
      "tradeExchange": "Q",
      "tradeTimestamp": "2026-04-20T07:11:01.717000-04:00"
    }
  }
}
Each Time & Sales message represents a single trade execution. You may receive multiple messages per second during active trading.
{
  "type": "event",
  "payload": {
    "action": "snapshot",
    "type": "quote",
    "symbol": "AAPL240119C00150000",
    "data": {
      "bidPrice": 5.25,
      "askPrice": 5.30,
      "bidSize": 50,
      "askSize": 75,
      "midPrice": 5.275,
      "spread": 0.05,
      "openInterest": 12450
    },
    "id": "sub-opt-1",
    "timestamp": 1701450000123
  }
}
Upon subscribing with greeksFields, the server immediately sends a snapshot of the last known Greeks values. Subsequent updates are streamed whenever Greeks are recalculated.1. Initial snapshot (received immediately on subscribe):
{
  "type": "event",
  "payload": {
    "action": "snapshot",
    "type": "greeks",
    "symbol": "XSP281215C00920000",
    "timestamp": 1770975436651,
    "data": {
      "delta": 0.522,
      "gamma": 0.0386,
      "impliedVolatility": 0.2752,
      "symbol": "XSP281215C00920000",
      "theta": -0.0246,
      "rho": 0.004,
      "timestamp": "2026-02-13T15:07:16.65+05:30",
      "vega": 0.1606
    }
  }
}
2. Real-time update (streamed when Greeks change):
{
  "type": "event",
  "payload": {
    "action": "update",
    "type": "greeks",
    "symbol": "XSP281215C00920000",
    "timestamp": 1770975502651,
    "data": {
      "delta": 0.531,
      "gamma": 0.0391,
      "impliedVolatility": 0.2788,
      "symbol": "XSP281215C00920000",
      "theta": -0.0249,
      "rho": 0.004,
      "timestamp": "2026-02-13T15:08:22.10+05:30",
      "vega": 0.1618
    }
  }
}
Selective fields (using greeksFields: ["delta", "impliedVolatility"]):
{
  "type": "event",
  "payload": {
    "action": "snapshot",
    "type": "greeks",
    "symbol": "AAPL240119C00150000",
    "timestamp": 1701450000890,
    "data": {
      "delta": 0.638,
      "impliedVolatility": 0.3105
    }
  }
}
Use action: "snapshot" vs action: "update" to distinguish the initial state from real-time changes. Only the fields you subscribed to are included in each message.

Update Responses

After the snapshot, you receive real-time updates with only changed fields:

Quote Update

{
  "type": "event",
  "payload": {
    "action": "update",
    "type": "quote",
    "symbol": "AAPL",
    "timestamp": 1701450001456,
    "data": {
      "bidPrice": 150.26,
      "bidSize": 600,
      "bidChange": 0.01,
      "bidSizeChange": 100,
      "bidTimestamp": 1701450001450
    }
  }
}
Bandwidth Optimization: Updates contain only fields that changed since the last message, minimizing network usage.
{
  "type": "event",
  "payload": {
    "action": "update",
    "type": "trade",
    "symbol": "GOOG",
    "timestamp": 1776683461767,
    "data": {
      "netChange": -3.1300000000000003,
      "price": 336.27000000000004,
      "size": 6,
      "symbol": "GOOG",
      "tradeTimestamp": "2026-04-20T07:11:01.717000-04:00"
    }
  }
}

Market Status Updates

After successful authentication and whenever market status changes, the server can send a market status event:
{
  "type": "event",
  "payload": {
    "action": "update",
    "type": "marketStatus",
    "data": {
      "market": "open",
      "serverTime": "2026-05-13T10:30:00Z",
      "exchanges": {
        "nyse": "open",
        "nasdaq": "open"
      },
      "currencies": {
        "fx": "open"
      },
      "afterHours": false,
      "earlyHours": false
    },
    "timestamp": 1701450000123
  }
}

Streaming event structure

Streaming market data events use the following envelope:
FieldTypeDescription
typestringOuter envelope type. Streaming market data events use event.
payload.actionstringEvent action: snapshot or update
payload.typestringData type: quote, trade, level2nOB, timeAndSales, greeks, or marketStatus
payload.symbolstringThe ticker or option symbol for symbol-specific events. Omitted for market status events.
payload.dataobjectThe event payload. Quote updates include only changed fields.
payload.idstringCorrelation ID when the server echoes a subscription request ID
payload.timestampintegerEvent timestamp in Unix milliseconds
Market data, unsubscribe confirmations, auth responses, and subscription errors use type: "event" with an action-specific payload. Protocol ping replies use type: "pong". On-demand queries use type: "response".

Error Handling

Error Response Format

{
  "type": "event",
  "payload": {
    "action": "error",
    "symbol": "INVALID",
    "error": "symbol not found",
    "id": "sub-1",
    "timestamp": 1701450000123
  }
}

Common Error Messages

MessageDescriptionResolution
authentication requiredThe connection must authenticate before this actionSend a POST /auth request message with a valid token
invalid subscribe formatSubscribe payload could not be parsed as an array of symbol requestsSend payload as an array of objects
invalid unsubscribe formatUnsubscribe payload could not be parsed as an array of strings or objectsSend payload as ["AAPL"] or [{ "symbol": "AAPL", "quote": true }]
no symbols providedThe request did not include any symbolsInclude at least one symbol
too many symbols in requestRequest exceeded the backend symbol limitSplit symbols across multiple requests
invalid quote fields: ...One or more quote field names are not supportedCheck field names against the quote field list
invalid trade fields: ...One or more trade field names are not supportedCheck field names against the trade field list
invalid greeks fields: ...One or more Greeks field names are not supportedUse only delta, gamma, theta, vega, rho, or impliedVolatility
Always implement error handling in your WebSocket client to handle network issues, invalid requests, and server errors gracefully.

Connection Management

Ping/Pong Keepalive

Send periodic pings to keep the WebSocket connection alive and detect network issues: Client sends:
{
  "type": "ping",
  "id": "ping-001"
}
Server responds:
{
  "type": "pong",
  "id": "ping-001",
  "timestamp": "2026-05-13T10:30:00Z",
  "payload": null
}
Recommended: Send a ping every 30-60 seconds to maintain the connection and detect disconnects quickly.

Handling Disconnects

const ws = new WebSocket('wss://api.aries.com/v1/market/ws');

ws.onclose = (event) => {
  console.log('WebSocket closed:', event.code, event.reason);

  // Implement reconnection logic with exponential backoff
  setTimeout(() => {
    reconnect();
  }, getBackoffDelay());
};

ws.onerror = (error) => {
  console.error('WebSocket error:', error);
};
Implement exponential backoff for reconnections: start with 1 second, then 2s, 4s, 8s, up to a maximum of 60 seconds.

Request/Response Pattern

Besides streaming subscriptions, the WebSocket supports on-demand queries using a RESTful-style request/response pattern.

Get Option Expiry Dates

Query all available expiration dates for an underlying symbol: Request:
{
  "type": "request",
  "id": "req-expiry-1",
  "payload": {
    "method": "GET",
    "path": "/options/AAPL/expiry-dates"
  }
}
Response:
{
  "type": "response",
  "id": "req-expiry-1",
  "payload": {
    "status": 200,
    "data": {
      "symbol": "AAPL",
      "expiryDates": [
        {
          "date": "2024-01-19"
        },
        {
          "date": "2024-02-16"
        },
        {
          "date": "2024-03-15"
        },
        {
          "date": "2024-04-19"
        }
      ]
    }
  }
}

Get Option Contract Symbols

Query all call and put contracts for a symbol and expiration date: Request:
{
  "type": "request",
  "id": "req-contracts-1",
  "payload": {
    "method": "GET",
    "path": "/options/AAPL/contracts/2024-01-19"
  }
}
For weekly contracts, include the optional frequency path segment:
{
  "type": "request",
  "id": "req-contracts-weekly-1",
  "payload": {
    "method": "GET",
    "path": "/options/SPX/contracts/2024-01-19/W"
  }
}
Response:
{
  "type": "response",
  "id": "req-contracts-1",
  "payload": {
    "status": 200,
    "data": {
      "symbol": "AAPL",
      "expiryDate": "2024-01-19",
      "calls": [
        {
          "symbol": "AAPL240119C00145000",
          "strikePrice": 145.00
        },
        {
          "symbol": "AAPL240119C00150000",
          "strikePrice": 150.00
        }
      ],
      "puts": [
        {
          "symbol": "AAPL240119P00145000",
          "strikePrice": 145.00
        },
        {
          "symbol": "AAPL240119P00150000",
          "strikePrice": 150.00
        }
      ]
    }
  }
}

Request Responses

Successful request replies are returned as type: "response" with payload.status and payload.data. Request/response errors use type: "response" with payload.status and payload.error. Streaming subscription errors use type: "event" with payload.action: "error".
Messages
Auth Request
type:object

Request to authenticate the WebSocket connection

Subscribe Request
type:object

Request to subscribe to market data for one or more symbols

Unsubscribe Request
type:object

Request to unsubscribe from market data

Ping Request
type:object

Keep-alive ping message

Get Expiry Dates Request
type:object

Request to get option expiration dates for a symbol

Get Contract Symbols Request
type:object

Request to get option contract symbols for a symbol and expiry date

Get Equity Snapshot Request
type:object

Request to get a full snapshot of equity data for a symbol

Quote Update
type:object

Real-time quote update for a subscribed symbol

Trade Update
type:object

Real-time trade/price update for a subscribed symbol

Level 2 / Order Book Update
type:object

Real-time Level 2 order book update showing market depth across exchanges

Time & Sales Update
type:object

Real-time trade execution from the time and sales feed

Greeks Update
type:object

Greeks snapshot on subscribe and real-time updates for an option contract

Error Response
type:object

Error message from the server

Auth Required Response
type:object

Server requests authentication

Refresh Auth Response
type:object

Server warns authentication expires soon

Auth Expired Response
type:object

Server notifies authentication has expired

Auth Success Response
type:object

Successful authentication response

Snapshot Response
type:object

Initial snapshot of market data after subscription

Unsubscribe Response
type:object

Confirmation of unsubscribe request

Pong Response
type:object

Response to ping request

Get Expiry Dates Response
type:object

Response containing option expiration dates

Get Contract Symbols Response
type:object

Response containing option contract symbols (calls and puts)

Get Equity Snapshot Response
type:object

Response containing comprehensive equity data snapshot

Market Status Update
type:object

Current market session status