ChartnautDocs

Options contracts

options.eod.contracts is the end-of-day US options chain behind options levels: one row per contract per trading day, with its closing quote, open interest, implied volatility and greeks. It is Raw Option Chains on the plans page, from the Pro plan. Read it through a dataset handle. Data Provided by Databento.

const oc = dataset("options.eod.contracts", {
  where: {
    underlying: { fromInstrument: true },
    dte: { lte: 7 },
    moneyness: { gte: 0.97, lte: 1.03 },
  },
  lookback: "4d",
});

On the SP500 chart, { fromInstrument: true } reads SPX (with SPXW) and SPY; on a chart without options data it is refused with this chart has no options data. This handle holds the contracts expiring within a week and struck within 3% of the forward.

Underlyings

Chart

underlying

root

S&P 500 charts

SPX

SPX (monthly, settled at the open), SPXW (weekly and daily, settled at the close)

S&P 500 charts

SPY

SPY

Which underlyings have chains now, from when and up to which day, is the dataset listing's coverage (GET /public/v1/datasets, the MCP tool list_datasets, the agent's find_datasets).

The chain follows the same rollout as options levels: SPX and SPY first, then NDX, QQQ, GLD and IBIT.

Fields

Prices and strikes are in the underlying's own units: SPX points and SPY dollars, not the chart's.

Field

Meaning

key

root|instrumentId|tradeDate

tradeDate

The trading day of the close, YYYY-MM-DD

underlying

SPX or SPY

root

SPX, SPXW or SPY

symbol

The contract's OSI symbol, e.g. SPX 260717C06600000

expiry

Expiry date, YYYY-MM-DD

expiresAt

When it settles, unix seconds: 09:30 New York time for SPX monthlies, 16:00 for the rest

settle

am or pm

putCall

C or P

strike

Strike price

multiplier

Contract multiplier, 100

bid, ask

The quote at 16:00 New York time (13:00 on a half day)

bid1615, ask1615

The quote at 16:15, for index options that trade after the stock close

openInterest

Open interest published the next morning, in contracts

volume

Contracts traded on the day

iv

Implied volatility as a decimal: 0.18 is 18%

delta

Change in price per 1.00 move in the underlying

gamma

Change in delta per 1.00 move in the underlying

vega

Change in price per 1 point of volatility

theta

Change in price per calendar day

forward

The forward price for the contract's expiry, from put-call parity

ivSource

Where iv comes from: quote (this contract's own quote), smile (interpolated within its expiry), surface (its expiry had no usable quotes near the price, so it was filled from the expiries either side). Optional

dte

Calendar days from tradeDate to expiry

moneyness

strike divided by forward

modelVersion

The maths version, eod-v3

knownFrom

When the row takes effect, unix seconds

Every number from bid to forward, and moneyness, is optional: a contract with no quote has no bid, and one whose price cannot be solved has no iv or greeks. Check for undefined before using one.

Filters

Field

Operators

underlying

equals, any of, { fromInstrument: true }

root

equals, any of

expiry

equals, any of, gte, lte

strike

equals, gte, lte

putCall

equals: C or P (call and put work too)

dte

gte, lte

moneyness

gte, lte

A contracts handle must filter on underlying or root. A field that takes gte and lte accepts both at once as a range, ends included: { strike: { gte: 6500, lte: 6800 } }. A range with its ends the wrong way round is refused.

Narrow every read

A full SPX and SPY chain is tens of thousands of contracts a day. A read returns at most 5,000 rows; past that, coverage.truncated is true and the rows nearest now are kept. Filter on dte, moneyness, expiry or strike so a day fits.

The default lookback is 1 day and the longest is 10 days. Use 4 days to always reach the newest chain across a weekend: on Monday before about 09:50 New York time the newest chain is Thursday's, published on Friday morning, and a 1-day lookback sees nothing. A run over a longer stretch of history is read 7 days at a time; Chartnaut splits it for you.

When rows become visible

A trading day's rows take effect with that day's levels: on the next trading day, usually about 09:50 New York time, and at 10:00 for days filled in from history. Every row of a day shares one knownFrom, so read the day's rows with within and keep the newest tradeDate. last returns one row only.

// The newest trading day's contracts this handle can see.
function latestChain() {
  const rows = oc.within({ before: "4d" });
  if (rows.length === 0) return [];
  const day = rows[rows.length - 1].tradeDate;
  return rows.filter((r) => r.tradeDate === day);
}

Examples

Each example below declares oc as at the top of this page and uses latestChain().

The front expiry's at-the-money straddle on SPX, in SPX points:

export function onBar(ctx) {
  const chain = latestChain().filter((r) => r.underlying === "SPX");
  if (chain.length === 0) return;
  const front = chain.map((r) => r.expiry).toSorted()[0];
  const atm = chain
    .filter((r) => r.expiry === front && r.moneyness !== undefined)
    .toSorted((a, b) => Math.abs(a.moneyness - 1) - Math.abs(b.moneyness - 1));
  const call = atm.find((r) => r.putCall === "C");
  const put = atm.find((r) => r.putCall === "P" && call && r.strike === call.strike);
  if (!call || !put || call.bid === undefined || call.ask === undefined || put.bid === undefined || put.ask === undefined) return;
  const straddle = (call.bid + call.ask) / 2 + (put.bid + put.ask) / 2;
}

Your own net gamma exposure, with dealers long calls and short puts, in dollars per 1% move:

function netGex(chain) {
  let total = 0;
  for (const r of chain) {
    if (r.gamma === undefined || r.openInterest === undefined || r.forward === undefined) continue;
    const sign = r.putCall === "C" ? 1 : -1;
    total += sign * r.gamma * r.openInterest * r.multiplier * r.forward * r.forward * 0.01;
  }
  return total;
}

Using forward in place of spot is close for near expiries. Summing in dollars makes SPX and SPY add up directly. The levels' netGex covers every expiry, so this narrower handle gives a smaller figure.

Calls only, between two dates, from a fixed strike range:

const calls = dataset("options.eod.contracts", {
  where: {
    root: "SPXW",
    putCall: "C",
    expiry: { gte: "2026-10-19", lte: "2026-10-23" },
    strike: { gte: 6500, lte: 7000 },
  },
  lookback: "4d",
});

Fixed dates and strikes suit a one-off study. On a chart, dte and moneyness keep moving with the market.

Plan

options.eod.contracts needs Pro. On Free, the editor flags the handle with options.eod.contracts is available from the Pro plan. and a run is refused with the same message. Chartnaut can change a dataset's plan, so the current one is in Datasets by plan. The levels themselves, including the per-strike profile, are in options.eod.levels, also on Pro.