Skip to content

Net Premium

Family: Flow surveillance

What it computes

Emits NetPremiumTick ticks carrying net_call_prem, net_put_prem, net_prem, cum_net_prem off option trade + NBBO.

Available on the live, historical, and replay drives.

Methodology

Per-root running net-premium odometer with Lee-Ready (1991) aggressor classification per print.

See the methodology overview for the citation index.

Inputs

Option trade + NBBO.

Key outputs

Net_call_prem, net_put_prem, net_prem, cum_net_prem. The full field set is in the tick table below.

Output schema (NetPremiumTick)

The field / type / description table below is regenerated from the NetPremiumTick 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.
datei32Trading-session date (YYYYMMDD).
ts_msi32Milliseconds since midnight at emission time.
net_call_premf64buy_call_prem − sell_call_prem (USD).
net_put_premf64buy_put_prem − sell_put_prem (USD).
net_premf64net_call_prem − net_put_prem (USD).
cum_net_premf64Same value as [Self::net_prem] — the downstream cumulative-net-premium odometer the desk pipes into session-spanning charts. Held as a separate field for industry-convention parity (Bloomberg / FlowAlgo / CBOE TradeAlert all ship cum_net_prem distinct from the per-tick net_prem).

Configuration (NetPremiumParams)

Regenerated from the NetPremiumParams Rust source — see the note above.

FieldTypeDescription
contractsSecurityFilterContracts the subscription tracks.
conditionsConditionPolicyTrade-condition admission policy.
venuesExchangeFilterExchange / venue admission policy.
classificationSideClassificationSide-classification policy applied to every admitted trade.
reference_quote_labelQuoteLabelQuote-cycle position cached as the Lee-Ready reference NBBO.

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

Rust

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

use kairos::{Client, NetPremiumRow};

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

let sub = client
    .live()
    .net_premium(["SPX"])
    .on_event(|row: &NetPremiumRow| println!("net_prem={} net_call={}", row.net_prem, row.net_call_prem))?;

// ... later, to stop delivery ...
sub.unsubscribe();
# Ok(())
# }

Proprietary. All rights reserved.