Skip to main content
WSS
/
v1
/
market
/
ws
What this stream gives you. Open one connection to wss://api.aries.com/v1/market/ws, authenticate once, and the server will push live prices, trades, and order-book activity for any symbols you ask about. You can stream the same data a professional trader watches on screen — bid/ask quotes, last sale prices, intraday OHLC, every individual trade as it prints, full depth-of-market, and option Greeks — without polling.

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. Pass them just as you’d type them on a brokerage screen — for example AAPL, MSFT, GOOGL, TSLA. No special formatting required.

Indices

Major market indices are supported:
SymbolIndex
SPXS&P 500 — broad large-cap U.S. stocks
NDXNasdaq 100 — 100 largest non-financial Nasdaq stocks
DJIDow Jones Industrial Average — 30 blue-chip U.S. stocks
VIXCBOE Volatility Index — market “fear gauge”
RUTRussell 2000 — small-cap U.S. stocks
COMPNasdaq Composite — all Nasdaq-listed stocks
NYANYSE Composite — all NYSE-listed stocks
OEXS&P 100 — 100 largest S&P 500 companies
MIDS&P MidCap 400 — mid-sized U.S. stocks
SMLS&P SmallCap 600 — small-cap U.S. stocks
Indices are computed values, not securities you can buy and sell directly, so they don’t have bid/ask quotes. When subscribing to an index, only request trade fields (lastPrice, openPrice, highPrice, lowPrice, netChange, totalVolume, etc.). Quote fields like bidPrice/askPrice will be empty.

Options

Option contracts use OSI (Options Symbology Initiative) symbols — the 21-character standard the U.S. options industry uses to uniquely identify a contract.The format is ROOT + YYMMDD + C/P + 00000000 (the strike price in cents, left-padded). For example, AAPL240119C00150000 decodes as:
  • AAPL — underlying stock
  • 240119 — expiration date, 2024-01-19
  • C — call (use P for a put)
  • 00150000 — strike price, $150.00 (00150000 ÷ 1000)
When subscribing to options, set symbolType: "option" so the server knows to apply option-specific routing and to enable Greeks if requested.

Quote Data

The best price a buyer is currently willing to pay (bid) and the best price a seller is currently willing to accept (ask), pulled from all U.S. exchanges combined — known as the NBBO (National Best Bid and Offer).

Trade Data

The price and size of the most recent trade, plus session-level totals: OHLC = Open, High, Low, Close — the standard four prices used to draw a candle on a chart.

Level 2 / Order Book Data

Market depth — every visible bid and ask across the major exchanges, not just the single best price. Lets you see how much demand is sitting at each price level and which exchanges are quoting it.

Time & Sales Data

Every individual trade as it prints, with price, size, timestamp, and the exchange where it executed. Often called “the tape” — traders use it to read order flow and gauge buying vs. selling pressure.

Greeks Data

For option contracts: the standard risk measures (delta, gamma, theta, vega, rho) plus implied volatility. The first message is a snapshot of the last known values; after that you receive updates whenever the Greeks are recalculated. Only available when symbolType: "option" and greeksFields is specified.

Market Status

Whether the U.S. market is currently open, closed, in pre-market, or in after-hours trading, plus the status of individual exchanges.
What you receive first: Quote, trade, and Greeks subscriptions all send an initial snapshot of the current state, then stream updates as values change. Level 2 is the exception — it does not send a snapshot, only live updates as new depth arrives from the exchanges.
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"
}
To keep latency low when the market is active, the server may bundle several updates into a single WebSocket frame and separate them with a newline character (\n). This format is called NDJSON — Newline-Delimited JSON.What this means for you: Don’t just call JSON.parse(frame) on every incoming message. Instead, split the frame on \n, drop empty lines, and parse each line independently. Otherwise you will silently lose messages whenever the server coalesces.

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

To start receiving data for a symbol, send a subscribe message. The payload is always an array, even when you only want one symbol — each item describes one symbol and the specific fields you want to receive for it. Subscription object fields:
FieldTypeRequiredWhat to enter
symbolstringYesA stock ticker (e.g. AAPL), an index code (e.g. SPX), or an OSI option symbol (e.g. AAPL240119C00150000).
symbolTypestringNoequity (default) for stocks and indices, or option for option contracts. Must be option if you want Greeks.
quoteFieldsstring | arrayNoQuote fields to subscribe to (see Quote Fields table below). Use ["*"] for all.
tradeFieldsstring | arrayNoTrade fields to subscribe to (see Trade Fields table below). Use ["*"] for all.
level2booleanNotrue to receive full order-book depth for this symbol. Defaults to false.
timeAndSalesbooleanNotrue to receive a message for every individual trade execution. Defaults to false.
timeAndSalesFieldsstring | arrayNoSpecific T&S fields to receive when timeAndSales: true. Defaults to all fields.
greeksFieldsstring | arrayNoGreek fields to subscribe to (options only). Use ["*"] for all.
{
  "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"]
    }
  ]
}
Defaults & shortcuts.
  • symbolType defaults to "equity". Set it to "option" only when you’re subscribing to an option contract.
  • If you omit both quoteFields and tradeFields, the server treats it as “send me everything” and subscribes you to all quote and all trade fields for that symbol.
  • Any field list (quoteFields, tradeFields, timeAndSalesFields, greeksFields) accepts either a single string ("bidPrice") or an array (["bidPrice", "askPrice"]). Arrays are recommended for consistency.

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.What are Greeks? Greeks are standard risk measures that tell you how an option’s price is likely to move when something changes — the underlying stock price, time, or volatility. They are the building blocks of options risk management.
FieldDescription
*Wildcard — subscribe to all available Greeks fields
deltaHow much the option’s price moves for a **1moveintheunderlyingstock.Callsare0to1,putsare1to0.A0.50deltacallgains1 move in the underlying stock**. Calls are 0 to 1, puts are -1 to 0. A 0.50 delta call gains ≈ 0.50 if the stock rises $1. Also a rough estimate of the probability the option expires in-the-money.
gammaHow much delta itself changes per $1 move in the underlying. High gamma = delta swings quickly, so position risk changes fast.
thetaHow much value the option loses per day purely from time passing (the “time decay”). Almost always negative for long option holders.
vegaHow much the option’s price changes for a 1-percentage-point change in implied volatility. Long options have positive vega — they gain when volatility rises.
rhoHow much the option’s price changes for a 1-percentage-point change in interest rates. Usually small for short-dated options.
impliedVolatilityThe market’s expectation of how volatile the underlying will be over the option’s life, expressed as a decimal: 0.2752 means 27.52% annualized. Higher IV = more expensive options.
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 always use event.
payload.actionstringWhat kind of event this is. One of: snapshot (the first message you receive after subscribing — current state), update (a real-time change), error (something went wrong), unsubscribe (the server confirming you’ve been removed from a feed).
payload.typestringWhich data category the event belongs to. One of: quote (best bid/ask), trade (last sale info), level2nOB (order book depth), timeAndSales (every individual trade), greeks (option risk measures), marketStatus (market session state).
payload.symbolstringThe ticker or option symbol the event is about. Omitted for market-wide events such as marketStatus.
payload.dataobjectThe actual data payload. Note that update messages only include fields that changed since the last message — fields not in the update have not changed.
payload.idstringCorrelation ID. When the event was triggered by one of your subscribe requests, the server echoes back the id you sent.
payload.timestampintegerWhen the event happened, in Unix milliseconds (epoch).
Quick guide to outer type values:
  • event — Streaming pushes from the server: market data, auth/refresh notifications, unsubscribe confirmations, subscription errors.
  • pong — Reply to a ping you sent. Used only for keep-alive.
  • response — Reply to an on-demand request you sent (e.g. fetching option expiry dates).

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