Skip to content

Put Call Parity Residual

Family: Stat-arb

What it computes

Emits PutCallParityResidualTick ticks carrying spot_anchor, tenor_years, strikes_used, max_abs_residual, per_strike (strike, call_mid, put_mid, implied_spot, residual_value) off chain snapshot.

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

Stoll (1969) / Black-Scholes-Merton (1973) European put-call parity residual C − P − (S − K · e^{-rT}) at every shared call+put strike; median-strike implied-spot anchor when no spot override supplied.

See the methodology overview for the citation index.

Inputs

Chain snapshot.

Key outputs

Spot_anchor, tenor_years, strikes_used, max_abs_residual, per_strike (strike, call_mid, put_mid, implied_spot, residual_value). The full field set is in the tick table below.

Output schema (PutCallParityResidualTick)

The field / type / description table below is regenerated from the PutCallParityResidualTick 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.
expirationi32Expiration YYYYMMDD anchoring the parity residuals.
spot_anchorf64Spot anchor used in the residual computation (median-strike implied spot when spot_override = 0.0, otherwise the caller- supplied override).
tenor_yearsf64Tenor in calendar years used in the discounting factor.
strikes_usedi32Count of shared call+put strikes the residual sweep admitted.
max_abs_residualf64Maximum absolute residual across the admitted strikes — the chain's worst-case synthetic-stock mispricing magnitude.
per_strikeVec<ParityResidualPoint>Per-strike residual points.

Configuration (PutCallParityResidualParams)

Regenerated from the PutCallParityResidualParams 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 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.
min_strikesi32Minimum number of strikes carrying both a call and a put for the residual sweep. Defaults to [DEFAULT_MIN_STRIKES] (1).
target_expirationi32Target expiration YYYYMMDD. 0 selects the front expiration.
risk_free_ratef64Annualised continuously-compounded risk-free rate. Defaults to [DEFAULT_RISK_FREE_RATE] (0.0).
spot_overridef64Spot override. 0.0 selects the median-strike implied spot from the chain (see implied_spot for the per-strike recovery). Defaults to [DEFAULT_SPOT_OVERRIDE] (0.0).

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

Rust

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

use kairos::{Client, PutCallParityResidualRow};

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

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

Proprietary. All rights reserved.