Appearance
OI Changes
Family: Flow surveillance
What it computes
Emits OiChangesTick ticks carrying contracts_used, net_oi_change, accumulation, unwind, rows[(expiration, right, strike, oi_today, oi_prev, oi_change, oi_change_pct)] off chain snapshot + today + prior-session OI.
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
Per-contract day-over-day open-interest delta oi_today - oi_prev — Kolanovic (2014) / SqueezeMetrics (2017) accumulation vs unwind ladder.
See the methodology overview for the citation index.
Inputs
Chain snapshot + today + prior-session OI.
Key outputs
Contracts_used, net_oi_change, accumulation, unwind, rows[(expiration, right, strike, oi_today, oi_prev, oi_change, oi_change_pct)]. The full field set is in the tick table below.
Output schema (OiChangesTick)
The field / type / description table below is regenerated from the OiChangesTick 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. |
contracts_used | i32 | Per-contract row count contributing to the ladder. |
net_oi_change | i64 | Net signed OI change across the chain Σ oi_change. |
accumulation | i64 | Sum of positive OI changes (accumulation). |
unwind | i64 | Sum of ` |
rows | Vec<OiChangeRow> | Per-contract delta rows, sorted by (expiration, strike, right) ascending. |
Configuration (OiChangesParams)
Regenerated from the OiChangesParams Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Underlying symbols the subscription tracks. |
conditions | ConditionPolicy | Trade-condition admission policy. |
venues | ExchangeFilter | Exchange / venue admission policy. |
oi_cache | Arc<OpenInterestCache> | Engine-wide option open-interest cache (current session). The empty default is a placeholder — the analytic's kernel reads today's OI off the cache; the cache slot is retained so the DefaultSpec hook can fail closed with the documented cache-dependency error. |
min_abs_delta | i64 | Minimum absolute OI delta ` |
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().oi_changes(["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()
.oiChanges(["SPX"])
.onEvent((tick) => {
console.log(tick);
});Rust
rust
// Cargo.toml:
// kairos = "0.1"
use kairos::{Client, OiChangesRow};
# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;
let sub = client
.live()
.oi_changes(["SPX"])
.on_event(|row: &OiChangesRow| println!("net_oi_change={} accumulation={}", row.net_oi_change, row.accumulation))?;
// ... later, to stop delivery ...
sub.unsubscribe();
# Ok(())
# }