Appearance
OI Heatmap
Family: Flow surveillance
What it computes
Emits OiHeatmapTick ticks carrying expiration, strike, oi_call, oi_put off chain snapshot + 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-(expiration, strike) open-interest grid recovered off the chain snapshot + open-interest cache pair — the SqueezeMetrics / Bloomberg OMON dealer-positioning OI map; flat-tick stream of N events per snapshot, one per admitted cell.
See the methodology overview for the citation index.
Inputs
Chain snapshot + OI.
Key outputs
Expiration, strike, oi_call, oi_put. The full field set is in the tick table below.
Output schema (OiHeatmapTick)
The field / type / description table below is regenerated from the OiHeatmapTick 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. Identical across every per-snapshot event burst. |
expiration | i32 | Expiration YYYYMMDD. |
strike | i32 | Strike in vendor units (dollars × 1000 in wire encoding). |
oi_call | i64 | Call-side open interest on the cell. 0 when only the put leg is hydrated. |
oi_put | i64 | Put-side open interest on the cell. 0 when only the call leg is hydrated. |
Configuration (OiHeatmapParams)
Regenerated from the OiHeatmapParams 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 with the other dealer-positioning analytics. |
venues | ExchangeFilter | Exchange / venue admission policy. |
oi_cache | Arc<OpenInterestCache> | Engine-wide option open-interest cache. The empty default is a placeholder — the analytic's kernel reads (expiration, right, strike) OI off the cache; the cache slot is retained so the DefaultSpec hook can fail closed with the documented cache-dependency error. |
min_oi_per_cell | i64 | Minimum total OI on a (expiration, strike) cell for the row to publish. Defaults to [DEFAULT_MIN_OI_PER_CELL]. |
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_heatmap(["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()
.oiHeatmap(["SPX"])
.onEvent((tick) => {
console.log(tick);
});Rust
rust
// Cargo.toml:
// kairos = "0.1"
use kairos::{Client, OiHeatmapRow};
# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;
let sub = client
.live()
.oi_heatmap(["SPX"])
.on_event(|row: &OiHeatmapRow| println!("strike={} oi_call={}", row.strike, row.oi_call))?;
// ... later, to stop delivery ...
sub.unsubscribe();
# Ok(())
# }