Appearance
Large Print Percentile
Family: Flow surveillance
What it computes
Emits LargePrintPercentileTick ticks carrying price, size, premium, size_threshold, n_session_prints off option trade tape.
Available on the live, historical, and replay drives.
Methodology
Jain / Chlamtac (1985) P² streaming-quantile block detector; fires per-event when admitted print size crosses the running per-session quantile estimate.
See the methodology overview for the citation index.
Inputs
Option trade tape.
Key outputs
Price, size, premium, size_threshold, n_session_prints. The full field set is in the tick table below.
Output schema (LargePrintPercentileTick)
The field / type / description table below is regenerated from the LargePrintPercentileTick 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 |
|---|---|---|
contract | Contract | Resolved contract metadata. |
date | i32 | Trading-session date in YYYYMMDD form. |
ms_of_day | i32 | Milliseconds since midnight. |
exchange | i32 | Exchange code that printed the trade. |
condition | i32 | Primary OPRA trade-condition code. |
price | f64 | Trade price. |
size | i32 | Trade size (contracts). |
premium | f64 | Premium (price × size × 100). |
size_threshold | f64 | Running per-session size quantile estimate at the time the print was classified. |
n_session_prints | i64 | Cumulative admitted print count over the session at emission time — the P² sample horizon n. |
Configuration (LargePrintPercentileParams)
Regenerated from the LargePrintPercentileParams Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Contracts the subscription tracks. Options-only — the analytic silently ignores stock / index trades at the on_tick entry point. |
conditions | ConditionPolicy | Trade-condition admission policy. |
venues | ExchangeFilter | Exchange / venue admission policy. |
quantile | f64 | Target quantile q in (0, 1). Defaults to [DEFAULT_QUANTILE] (0.99). |
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().large_print_percentile(["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()
.largePrintPercentile(["SPX"])
.onEvent((tick) => {
console.log(tick);
});Rust
rust
// Cargo.toml:
// kairos = "0.1"
use kairos::{Client, LargePrintPercentileRow};
# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;
let sub = client
.live()
.large_print_percentile(["SPX"])
.on_event(|row: &LargePrintPercentileRow| println!("premium={} size={}", row.premium, row.size))?;
// ... later ...
sub.unsubscribe();
# Ok(())
# }