Appearance
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.
| Field | Type | Description |
|---|---|---|
symbol | Arc<str> | Underlying symbol. |
date | i32 | Trading-session date (YYYYMMDD). |
ts_ms | i32 | Milliseconds since midnight at emission time. |
net_call_prem | f64 | buy_call_prem − sell_call_prem (USD). |
net_put_prem | f64 | buy_put_prem − sell_put_prem (USD). |
net_prem | f64 | net_call_prem − net_put_prem (USD). |
cum_net_prem | f64 | Same 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.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Contracts the subscription tracks. |
conditions | ConditionPolicy | Trade-condition admission policy. |
venues | ExchangeFilter | Exchange / venue admission policy. |
classification | SideClassification | Side-classification policy applied to every admitted trade. |
reference_quote_label | QuoteLabel | Quote-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(())
# }