Appearance
Variance Swap Quote
Family: Volatility
What it computes
Emits VarianceSwapQuoteTick ticks carrying variance_implied, vol_implied, forward off full chain strip.
Available on the live, historical, and replay drives.
Methodology
Carr-Madan (1998) model-free variance.
See the methodology overview for the citation index.
Inputs
Full chain strip.
Key outputs
Variance_implied, vol_implied, forward. The full field set is in the tick table below.
Output schema (VarianceSwapQuoteTick)
The field / type / description table below is regenerated from the VarianceSwapQuoteTick Rust source by docs-site/scripts/inject-doc-tables.ts on every npm run docs:build. Do not hand-edit between the sentinels.
| Field | Type | Description |
|---|---|---|
root | Arc<str> | Underlying root ("SPX", "QQQ", …). Subscribers identify the quote series by (root, expiration) — root is the institutional ticker convention used by every CBOE / OPRA downstream tape, matching the Bloomberg OMON symbology. |
expiration | i32 | Expiration date in YYYYMMDD form. |
date | i32 | Trading-session date of the emission (YYYYMMDD). |
ms_of_day | i32 | Milliseconds since midnight at emission time. |
variance_implied | f64 | σ²(T) — annualised model-free implied variance per the Carr-Madan replication formula. f64::NAN whenever the strip fails the minimum-strikes gate (DEFAULT_MIN_STRIKES) or carries no parity-anchored forward. |
vol_implied | f64 | σ(T) = sqrt(variance_implied) — annualised implied volatility, the per-expiration quote subscribers convert directly into a vol-of-vol comparison or feed downstream variance-swap pricers. f64::NAN whenever variance_implied is NaN or negative (the latter shouldn't happen on a well-formed strip but is guarded against numerical edge cases). |
forward_price | f64 | Forward F derived from put-call parity at K* (the strike where ` |
n_strikes_used | i32 | Number of distinct strikes that contributed to the Σᵢ integration. Includes K₀ plus every admitted OTM strike on each side. Int32 on the wire schema. |
strip_width_pct | f64 | (K_high - K_low) / forward × 100 — the percentage strip width around the forward, the institutional "how wide does my chain go" diagnostic. Tight strips (sub-10 %) on illiquid forwards signal the integration was truncated by the chain shape rather than the zero-bid gate; wide strips (>50 %) are the SPX nirvana case. f64::NAN when forward_price is NaN or n_strikes_used == 0. |
Configuration (VarianceSwapQuoteParams)
Regenerated from the VarianceSwapQuoteParams Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Contracts the subscription tracks. The institutional idiom is to subscribe by underlying root ([SecurityFilter::Symbols]) — the engine fans out across every option on the chain. |
rate | Arc<dyn RateService> | Risk-free rate provider. Looked up per emission with (event_date, expiry_date); production deployments inject a curvekit-backed provider that auto-refreshes on date rollover. |
risk_free_rate_override | f64 | Optional rate override applied per-(root, expiration) ahead of [Self::rate]. A finite value pins it for every emission; f64::NAN (the constructor default) falls through to [Self::rate]. The override exists for research / replay reproducibility where the desk wants a fixed-rate sanity check independent of the curve service. NaN is the institutional "absent" sentinel — the same convention every chain-level vol analytic in this catalogue uses for "no override". |
venues | ExchangeFilter | Exchange / venue admission policy. |
emit | EmitPolicy | Emission policy. - [EmitPolicy::OnExchangeInterval] (default, with [DEFAULT_EMIT_INTERVAL_MS] interval) — variance-swap desk publish cadence. The analytic accumulates NBBO snapshots on every admitted Quote, then publishes one row per (root, expiration) per cadence bucket on the first qualifying tick whose ms_of_day crosses the next boundary. - [EmitPolicy::OnEveryTick] — research mode: fire one tick per admitted Quote per (root, expiration) per ms_of_day advance. - [EmitPolicy::OnClose] — accumulate; fire on the watermark sweep. |
emit_interval_ms | u32 | Per-(root, expiration) cadence in milliseconds. Honoured by the OnExchangeInterval emit policy (the default). Pinned to [DEFAULT_EMIT_INTERVAL_MS] = 60_000 ms (one minute) on construction; downstream callers override via the builder surface. |
min_strikes | u16 | Minimum strikes admitted to Σᵢ before a quote fires. Defaults to [DEFAULT_MIN_STRIKES] = 3 (CBOE's two-strike-per-leg floor plus K₀). Below the floor variance_implied and vol_implied surface as NaN. |
calendar | Arc<dyn MarketCalendar> | Market calendar provider. Used to derive the option-trading cutoff for time-to-expiration year-fractions. |
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().variance_swap_quote(["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()
.varianceSwapQuote(["SPX"])
.onEvent((tick) => {
console.log(tick);
});Rust
rust
// Cargo.toml:
// kairos = "0.1"
use kairos::{Client, VarianceSwapQuoteRow};
# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;
let sub = client
.live()
.variance_swap_quote(["SPX"])
.on_event(|row: &VarianceSwapQuoteRow| println!("variance_implied={} vol_implied={}", row.variance_implied, row.vol_implied))?;
// ... later ...
sub.unsubscribe();
# Ok(())
# }