Appearance
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.
| Field | Type | Description |
|---|---|---|
symbol | Arc<str> | Underlying symbol (interned). |
date | i32 | Trading-session date (YYYYMMDD) at emission time. |
ms_of_day | i32 | Milliseconds since midnight at emission time. |
expiration | i32 | Expiration YYYYMMDD anchoring the parity residuals. |
spot_anchor | f64 | Spot anchor used in the residual computation (median-strike implied spot when spot_override = 0.0, otherwise the caller- supplied override). |
tenor_years | f64 | Tenor in calendar years used in the discounting factor. |
strikes_used | i32 | Count of shared call+put strikes the residual sweep admitted. |
max_abs_residual | f64 | Maximum absolute residual across the admitted strikes — the chain's worst-case synthetic-stock mispricing magnitude. |
per_strike | Vec<ParityResidualPoint> | Per-strike residual points. |
Configuration (PutCallParityResidualParams)
Regenerated from the PutCallParityResidualParams Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Underlying symbols the subscription tracks. |
conditions | ConditionPolicy | Trade-condition admission policy. Retained for surface consistency. |
venues | ExchangeFilter | Exchange / venue admission policy. Retained for surface consistency. |
daily_close | Arc<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_strikes | i32 | Minimum number of strikes carrying both a call and a put for the residual sweep. Defaults to [DEFAULT_MIN_STRIKES] (1). |
target_expiration | i32 | Target expiration YYYYMMDD. 0 selects the front expiration. |
risk_free_rate | f64 | Annualised continuously-compounded risk-free rate. Defaults to [DEFAULT_RISK_FREE_RATE] (0.0). |
spot_override | f64 | Spot 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(())
# }