Skip to content

WebSockets · Options

Options exposure stream

Modeled dealer exposure of every Greek.
WS/v1/ws/options/exposurewsOptionsExposure
On this page

The net modeled dealer exposure of all thirteen Greeks over the full chain (gamma, delta, vanna, charm, vega, theta, rho, vomma, veta, speed, zomma, color and ultima), with the spot, the gamma regime, the zero-gamma level and the call and put walls of the same valuation. The numbers are OrderMap's own model of positioning (the classic open-interest model, dealer perspective), not reported positions. unit is the exposure unit and units names it for each Greek, as GET /v1/options/exposure/sheet does. The valuation is checked at most once every 5 seconds per root and an event is sent when it changed; the first event after subscribing is the current state (it can take up to 5 seconds). Subscribe by option root or family (SPX covers SPX and SPXW; SPXW only the weekly root). At most 25 distinct option roots are served at once across all connections (an operator setting); a subscription to one more is answered with a status event, state unavailable and reason capacity, until a slot frees.

Connect and subscribe

Open wss://api.ordermap.si/v1/ws/options/exposure?symbols=SPXW with your key in the Authorization header and your saved installation ID in X-OrderMap-Device-ID, then send a subscribe message. Up to 25 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/options/exposure?symbols=SPXW", {
  headers: {
    Authorization: `Bearer ${process.env.ORDERMAP_API_KEY}`,
    "X-OrderMap-Device-ID": deviceId,
  },
});

ws.on("open", () => ws.send(JSON.stringify({ action: "subscribe", symbols: ["SPXW"] })));
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":["SPXW"]}

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.

ParameterType and limitsDescription
X-OrderMap-Device-IDheaderoptionalstringat 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.

ParameterType and limitsDescription
symbolsqueryoptionalarray<string>comma-separated in one parameter1 to 25 itemseach at most 128 characterspattern ^[A-Za-z][A-Za-z0-9.]{0,9}$Symbols to subscribe to (up to 25).

Event

Each event is one message: {"type":"event","event_type":"options.exposure","seq":N,"data":{...}}.

data of options.exposure

  • call_wallnumber | nullrequiredStrike of the largest positive call gamma exposure.
  • netobjectrequiredThe net modeled dealer exposure of each Greek over the full chain (calls plus puts); null when the chain cannot be valued.13 fields inside
    • charmnumber | nullrequiredNet charm exposure in the unit named in units.
    • colornumber | nullrequiredNet color exposure in the unit named in units.
    • deltanumber | nullrequiredNet delta exposure in the unit named in units.
    • gammanumber | nullrequiredNet gamma exposure in the unit named in units.
    • rhonumber | nullrequiredNet rho exposure in the unit named in units.
    • speednumber | nullrequiredNet speed exposure in the unit named in units.
    • thetanumber | nullrequiredNet theta exposure in the unit named in units.
    • ultimanumber | nullrequiredNet ultima exposure in the unit named in units.
    • vannanumber | nullrequiredNet vanna exposure in the unit named in units.
    • veganumber | nullrequiredNet vega exposure in the unit named in units.
    • vetanumber | nullrequiredNet veta exposure in the unit named in units.
    • vommanumber | nullrequiredNet vomma exposure in the unit named in units.
    • zommanumber | nullrequiredNet zomma exposure in the unit named in units.
  • put_wallnumber | nullrequiredStrike of the largest negative put gamma exposure.
  • regimestring | nullrequiredGamma regime of the model: positive, negative or neutral.positivenegativeneutralnull
  • spotnumber | nullrequiredUnderlying price of the valuation; null when unknown.
  • symbolstringrequiredThe root or family subscribed to.
  • timestampintegerunix-msrequiredTime of the valuation. Unix epoch milliseconds (UTC).
  • unitstringrequiredThe exposure unit, as on the REST routes: per_percent (per 1% move), per_dollar (per $1) or raw (per 1 unit).per_percentper_dollarraw
  • unitsobjectrequiredThe unit label of each Greek's exposure, for example usd_per_pct.13 fields inside
    • charmstringrequiredUnit of the charm exposure.
    • colorstringrequiredUnit of the color exposure.
    • deltastringrequiredUnit of the delta exposure.
    • gammastringrequiredUnit of the gamma exposure.
    • rhostringrequiredUnit of the rho exposure.
    • speedstringrequiredUnit of the speed exposure.
    • thetastringrequiredUnit of the theta exposure.
    • ultimastringrequiredUnit of the ultima exposure.
    • vannastringrequiredUnit of the vanna exposure.
    • vegastringrequiredUnit of the vega exposure.
    • vetastringrequiredUnit of the veta exposure.
    • vommastringrequiredUnit of the vomma exposure.
    • zommastringrequiredUnit of the zomma exposure.
  • zero_gammanumber | nullrequiredUnderlying price at which the modeled net gamma changes sign; null when it does not within the sweep.

Example event

{
  "type": "event",
  "event_type": "options.exposure",
  "seq": 1,
  "data": {
    "call_wall": 6050,
    "net": {
      "charm": -350000000,
      "color": -2100000,
      "delta": 11000000000,
      "gamma": 2700000000,
      "rho": 3100000,
      "speed": 8000000,
      "theta": 12000000,
      "ultima": 4000,
      "vanna": 400000000,
      "vega": -9800000,
      "veta": -140000,
      "vomma": 220000,
      "zomma": 1500000
    },
    "put_wall": 5950,
    "regime": "positive",
    "spot": 6021.4,
    "symbol": "SPX",
    "timestamp": 1792161060000,
    "unit": "per_percent",
    "units": {
      "charm": "usd_per_day",
      "color": "usd_per_day",
      "delta": "usd_per_pct",
      "gamma": "usd_per_pct",
      "rho": "usd_per_pct_rate",
      "speed": "usd_per_pct",
      "theta": "usd_per_day",
      "ultima": "usd_per_volpt",
      "vanna": "usd_per_volpt",
      "vega": "usd_per_volpt",
      "veta": "usd_per_volpt_per_day",
      "vomma": "usd_per_volpt_per_volpt",
      "zomma": "usd_per_volpt"
    },
    "zero_gamma": 5890
  }
}

Before the upgrade

Errors before the upgrade are ordinary JSON errors; after it, problems arrive as messages and close codes (see WebSockets).

StatusMeaningBody
101Switching protocols: WebSocket protocol ordermap.v1.Switching protocols
400Invalid handshake parameters or missing, malformed or conflicting persistent device identifier.Error object
401Missing or invalid API key (Authorization, X-API-Key or, from a browser, the ordermap.key. subprotocol).Error object
403The plan has no streaming (streaming_not_in_plan), the dataset is not released, or the account is suspended.Error object
409stream_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-AfterError object
426The request is not a WebSocket upgrade.Error object
429Rate limit or WebSocket cooldown.Retry-AfterError object
503stream_unavailable: the stream is not enabled or its source is down; retry after Retry-After seconds.Retry-AfterError object

Authenticated responses carry the X-RateLimit-* headers (see rate limits); 429 and 503 add Retry-After.