Skip to content

Vertical Arb Residual

Family: Stat-arb

What it computes

Emits VerticalArbResidualTick ticks carrying pairs_used, violations, min_residual, per_pair (strike_low, strike_high, 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

Merton (1973) Theorem 2 vertical-spread monotonicity residual C(K_low) − C(K_high) at every adjacent strike pair on the listed call-mid strip — strike-monotonicity screen.

See the methodology overview for the citation index.

Inputs

Chain snapshot.

Key outputs

Pairs_used, violations, min_residual, per_pair (strike_low, strike_high, residual_value). The full field set is in the tick table below.

Output schema (VerticalArbResidualTick)

The field / type / description table below is regenerated from the VerticalArbResidualTick 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 for which the residuals were recovered.
pairs_usedi32Count of adjacent strike pairs the residual sweep admitted.
violationsi32Count of admitted pairs whose residual is strictly negative — the chain's vertical-spread arbitrage violation count.
min_residualf64Minimum recovered residual across the admitted pairs; negative values flag a vertical violation.
per_pairVec<VerticalResidualPoint>Per-pair residual points, oldest-pair first.

Configuration (VerticalArbResidualParams)

Regenerated from the VerticalArbResidualParams 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 admitted strikes for the residual sweep. Defaults to [DEFAULT_MIN_STRIKES] (2).
target_expirationi32Target expiration YYYYMMDD. 0 selects the front expiration on the supplied chain snapshot.

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

Rust

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

use kairos::{Client, VerticalArbResidualRow};

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

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

Proprietary. All rights reserved.