Skip to content

Opex Pinning

Family: Flow surveillance

What it computes

Emits OpexPinningTick ticks carrying top_pin_strikes[], dominant_strike off chain + spot.

Available on the live, historical, and replay drives.

Methodology

Gaussian-weighted GEX concentration.

See the methodology overview for the citation index.

Inputs

Chain + spot.

Key outputs

Top_pin_strikes[], dominant_strike. The full field set is in the tick table below.

Output schema (OpexPinningTick)

The field / type / description table below is regenerated from the OpexPinningTick Rust source by docs-site/scripts/inject-doc-tables.ts on every npm run docs:build. Do not hand-edit between the sentinels.

FieldTypeDescription
contractContractResolved underlying contract metadata. Subscribers identify the underlying by (symbol, …) on this field — the wire-level contract id is engine-internal and is not surfaced here.
datei32Trading-session date in YYYYMMDD form.
ms_of_dayi32Milliseconds-of-day at emission time.
expirationi32Expiration the projection targets (YYYYMMDD).
dtei32Calendar days from date to expiration — gates the emission (only dte ≤ dte_threshold rows surface).
spotf64Underlying spot used to compute the Gaussian distance kernel.
sigmaf64Gaussian distance kernel width, in dollars. Scales with dte and IV per the inline derivation; surfaced so downstream consumers can audit the kernel.
dominant_pin_strikef64Strike with the highest pin_score. f64::NAN when no strike carries a finite pin score (no admitted contributions yet).
dominant_pin_strengthf64dominant_pin_strike's share of the total pin force, in percent: pin_score(dominant) / Σ pin_score × 100. f64::NAN when there are no admitted contributions.
top_pin_strikesVec<PinStrikeRow>Top pin candidates by pin_score, sorted descending. Length is min(top_strikes_emit, number of admitted strikes).

Configuration (OpexPinningParams)

Regenerated from the OpexPinningParams Rust source — see the note above.

FieldTypeDescription
contractsSecurityFilterContracts the subscription tracks. Typically a [SecurityFilter::Symbols] entry naming the underlying roots.
rateArc<dyn RateService>Risk-free rate provider, shared with the Greeks / GEX analytics.
calendarArc<dyn MarketCalendar>Market calendar provider, shared with the Greeks / GEX analytics.
annual_dividendOption<f64>Annual continuously compounded dividend yield. None (default) treats the underlying as non-dividend-paying.
dividend_cache`std::sync::Arc<crate::reference_data::dividend_yield::
DividendYieldCache>`Engine-wired per-symbol dividend-yield cache. Seated at subscribe time by DefaultSpec via wire_dividend_yield. Consulted on the dispatch path only when annual_dividend is None — the per-tick lookup resolves the continuous-dividend carry yield q = D / S from the live underlying spot the analytic already holds (O(1), lock-light, non-blocking). An explicit annual_dividend override always wins.
oi_cacheArc<OpenInterestCache>Engine-wide option open-interest cache. Build at Client::connect and clone the resulting Arc into the spec.
spot_cacheSpotPriceCacheShared underlying-spot cache, populated by the engine from stock NBBO quotes.
contract_multiplierf64Contract multiplier. Default 100.0 for US-listed equity options.
dte_thresholdi32Maximum DTE (calendar days) at which the analytic emits. Default 7 — the canonical OPEX-week window over which dealer-gamma pinning meaningfully dominates spot tape. Set higher to surface pre-OPEX projections.
top_strikes_emitu32Number of top-pin candidates to include in [super::tick::OpexPinningTick::top_pin_strikes]. Default 5 — matches the institutional OPEX board's top-of-list shape.
sigma_floorf64Floor on the Gaussian distance-kernel width, in dollars. Prevents the kernel collapsing to a delta function on a same-day expiration with a tiny IV reading. Default 0.50.
default_ivf64Annualised IV proxy when the analytic cannot solve a live IV for the chain (cold start, sparse mids). Default 0.20 (20% annualised) — institutional roll-up over the S&P realised-vol band.
min_emit_interval_msi64Minimum interval between emissions per (symbol, expiration), in milliseconds. Defaults to 1_000 (one snapshot per second).
conditionsConditionPolicyTrade-condition admission policy (gates which quote ticks can feed the IV solve).
venuesExchangeFilterExchange / venue admission policy applied to option quotes.

Example

Python

python
import kairos_thetadata as kt

client = kt.Client.connect(kt.Credentials.from_env())

def on_event(row):
    print(row)

sub = client.live().opex_pinning(["SPX"]).on_event(on_event)
sub.wait(timeout_seconds=60.0)

TypeScript

typescript
import { Client, Credentials } from "kairos-thetadata";

const client = await Client.connect(Credentials.fromEnv());

await client
  .live()
  .opexPinning(["SPX"])
  .onEvent((tick) => {
    console.log(tick);
  });

Rust

rust
// Cargo.toml:
//   kairos = "0.1"

use kairos::{Client, OpexPinningRow};

# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;

let sub = client
    .live()
    .opex_pinning(["SPX"])
    .on_event(|row: &OpexPinningRow| println!("dte={} spot={}", row.dte, row.spot))?;

// ... later, to stop delivery ...
sub.unsubscribe();
# Ok(())
# }

Proprietary. All rights reserved.