WebSockets · Indices
Indices implied stream
/v1/ws/indices/impliedwsIndicesImpliedOn this page
The cash index level implied by its futures, implied_price = F x e^-(r-q)T (F the futures price, r the risk-free rate, q the dividend yield, T the time to the contract's final settlement), and fair_value_basis, the futures price minus implied_price in index points. An event is sent whenever the futures price changes, at most 60 per second per index, including outside the cash session, when no official index value exists; session says whether the futures price was seen during the cash session (rth) or outside it (gth). Overnight data is part of API Pro, which every stream requires. Neither value is an official index print. Needs the futures and indices dataset releases.
Connect and subscribe
Open wss://api.ordermap.si/v1/ws/indices/implied?symbols=SPX with your key in the Authorization header and your saved installation ID in X-OrderMap-Device-ID, then send a subscribe message. Up to 10 symbols per connection. Streams need API Pro. All keys and projects share one active device per account and one connection per event type. Reuse the same installation ID for every stream and reconnect. Browser subprotocols, limits and close codes are in WebSockets.
Node.js
import WebSocket from "ws";
// Create a UUID once per installation, save it, and reuse it for every stream.
const deviceId = process.env.ORDERMAP_DEVICE_ID;
if (!deviceId) throw new Error("Set ORDERMAP_DEVICE_ID to this installation's saved UUID.");
const ws = new WebSocket("wss://api.ordermap.si/v1/ws/indices/implied?symbols=SPX", {
headers: {
Authorization: `Bearer ${process.env.ORDERMAP_API_KEY}`,
"X-OrderMap-Device-ID": deviceId,
},
});
ws.on("open", () => ws.send(JSON.stringify({ action: "subscribe", symbols: ["SPX"] })));
ws.on("message", (raw) => {
const message = JSON.parse(raw.toString());
if (message.type === "event") console.log(message.seq, message.data);
if (message.type === "gap") console.warn("continuity lost: refetch the range over REST", message);
});
ws.on("close", (code, reason) => console.log("closed", code, reason.toString()));Subscribe message
{"action":"subscribe","symbols":["SPX"]}Upgrade headers
A persistent installation ID is required. Supply the header below, or offer it as an ordermap.device.<id> browser subprotocol with ordermap.v1. Reuse the same saved ID for every event type, key, project and reconnect. Headers are not subscription filters.
| Parameter | Type and limits | Description |
|---|---|---|
X-headeroptional | stringat least 16 charactersat most 128 characterspattern ^[A-Za-z0-9_-]{16,128}$ | Required unless supplied as an ordermap.device.<id> subprotocol together with ordermap.v1. Generate one random identifier per client installation and persist it across event types, keys, projects and reconnects. Never send it in the URL. |
Subscription parameters
1 parameter, none required. Send them in the query string of the upgrade request, or as the filters of a subscribe message.
| Parameter | Type and limits | Description |
|---|---|---|
symbolsqueryoptional | array<string>comma-separated in one parameter1 to 10 itemseach at most 128 characterspattern ^[A-Za-z][A-Za-z0-9.]{0,9}$ | Symbols to subscribe to (up to 10). |
Event
Each event is one message: {"type":"event","event_type":"indices.implied","seq":N,"data":{...}}.
data of indices.implied
contractstringrequiredFutures contract used.dividend_yieldnumberrequiredContinuous annual dividend yield used.fair_value_basisnumberrequiredThe futures price minus implied_price, in index points.implied_pricenumberrequiredThe futures price carried back to the index by cost of carry, F x e^-(r-q)T.ratenumberrequiredContinuously compounded annual risk-free rate used.sessionstringrequiredrth when the futures price was seen during the cash session, gth outside it.rthgthsymbolstringrequiredIndex symbol, for example SPX.timestampintegerunix-msrequiredTime of the futures price. Unix epoch milliseconds (UTC).
Example event
{
"type": "event",
"event_type": "indices.implied",
"seq": 1,
"data": {
"contract": "ESZ6",
"dividend_yield": 0.013,
"fair_value_basis": 29.66,
"implied_price": 5991.84,
"rate": 0.0412,
"session": "gth",
"symbol": "SPX",
"timestamp": 1792195200123
}
}Before the upgrade
Errors before the upgrade are ordinary JSON errors; after it, problems arrive as messages and close codes (see WebSockets).
| Status | Meaning | Body |
|---|---|---|
101 | Switching protocols: WebSocket protocol ordermap.v1. | Switching protocols |
400 | Invalid handshake parameters or missing, malformed or conflicting persistent device identifier. | Error object |
401 | Missing or invalid API key (Authorization, X-API-Key or, from a browser, the ordermap.key. subprotocol). | Error object |
403 | The plan has no streaming (streaming_not_in_plan), the dataset is not released, or the account is suspended. | Error object |
409 | stream_connection_limit: the account is already connected on another device, or already has this event type open on the active device. The existing connection is preserved.Retry-After | Error object |
426 | The request is not a WebSocket upgrade. | Error object |
429 | Rate limit or WebSocket cooldown.Retry-After | Error object |
503 | stream_unavailable: the stream is not enabled or its source is down; retry after Retry-After seconds.Retry-After | Error object |
Authenticated responses carry the X-RateLimit-* headers (see rate limits); 429 and 503 add Retry-After.
