Skip to content

Forward Variance

Family: Volatility

What it computes

Emits ForwardVarianceTick ticks carrying near_variance, far_variance, forward_variance, forward_volatility off chain snapshot (multi-expiration).

Available on the live and replay drives. The historical drive fails closed with KAIROS_ERR_HISTORICAL_UNWIRED until the relevant cache is hydrated externally.

Methodology

Demeterfi-Derman-Kamal-Zou (1999) VIX-style forward variance swap rate (T2*σ²(T2) - T1*σ²(T1)) / (T2-T1) over Carr-Madan strip integrals.

See the methodology overview for the citation index.

Inputs

Chain snapshot (multi-expiration).

Key outputs

Near_variance, far_variance, forward_variance, forward_volatility. The full field set is in the tick table below.

Output schema (ForwardVarianceTick)

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

FieldTypeDescription
symbolArc<str>Underlying symbol (interned).
datei32Trading-session date (YYYYMMDD) at emission time.
ms_of_dayi32Milliseconds since midnight at emission time.
near_expirationi32Near expiration YYYYMMDD that anchored σ²(T₁).
far_expirationi32Far expiration YYYYMMDD that anchored σ²(T₂).
near_variancef64σ²(T₁) recovered from the near strip.
far_variancef64σ²(T₂) recovered from the far strip.
forward_variancef64Forward variance (T₂ · σ²(T₂) − T₁ · σ²(T₁)) / (T₂ − T₁) — the institutional term-premium reading.
forward_volatilityf64Annualised forward volatility √(forward_variance). NaN when the forward variance is negative (chain inconsistency).
near_tenor_yearsf64T₁ in calendar years.
far_tenor_yearsf64T₂ in calendar years.

Configuration (ForwardVarianceParams)

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

FieldTypeDescription
contractsSecurityFilterUnderlying symbols the subscription tracks.
conditionsConditionPolicyTrade-condition admission policy. Retained for surface consistency.
venuesExchangeFilterExchange / venue admission policy. Retained for surface consistency.
daily_closeArc<DailyCloseCache>Boot-time hydrated daily-close history. The empty default is a placeholder — the analytic's kernel consumes a chain snapshot rather than the daily-close history, but the cache slot is retained so the DefaultSpec hook can fail closed with the same documented cache-dependency error the other vol analytics surface.
min_strikes_per_expirationi32Minimum number of admitted strikes per expiration for the strip integration to publish a real-valued variance. Defaults to [DEFAULT_MIN_STRIKES_PER_EXP] (5).
near_expirationi32Near expiration target YYYYMMDD. 0 selects the front expiration on the supplied chain snapshot.
far_expirationi32Far expiration target YYYYMMDD. 0 selects the second- nearest expiration after near_expiration.

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().forward_variance(["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()
  .forwardVariance(["SPX"])
  .onEvent((tick) => {
    console.log(tick);
  });

Rust

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

use kairos::{Client, ForwardVarianceRow};

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

let sub = client
    .live()
    .forward_variance(["SPX"])
    .on_event(|row: &ForwardVarianceRow| println!("forward_variance={} forward_volatility={}", row.forward_variance, row.forward_volatility))?;
// ... later ...
sub.unsubscribe();
# Ok(())
# }

Proprietary. All rights reserved.