Skip to content

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.

FieldTypeDescription
symbolArc<str>Underlying symbol (interned).
datei32Trading-session date (YYYYMMDD) at emission time.
ms_of_dayi32Milliseconds since midnight at emission time. Identical across every per-snapshot event burst.
expirationi32Expiration YYYYMMDD.
strikei32Strike in vendor units (dollars × 1000 in wire encoding).
oi_calli64Call-side open interest on the cell. 0 when only the put leg is hydrated.
oi_puti64Put-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.

FieldTypeDescription
contractsSecurityFilterUnderlying symbols the subscription tracks.
conditionsConditionPolicyTrade-condition admission policy. Retained for surface consistency with the other dealer-positioning analytics.
venuesExchangeFilterExchange / venue admission policy.
oi_cacheArc<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_celli64Minimum 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(())
# }

Proprietary. All rights reserved.