Skip to content

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.

FieldTypeDescription
contractContractResolved contract metadata.
datei32Trading-session date in YYYYMMDD form.
ms_of_dayi32Milliseconds since midnight.
exchangei32Exchange code that printed the trade.
conditioni32Primary OPRA trade-condition code.
pricef64Trade price.
sizei32Trade size (contracts).
premiumf64Premium (price × size × 100).
size_thresholdf64Running per-session size quantile estimate at the time the print was classified.
n_session_printsi64Cumulative 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.

FieldTypeDescription
contractsSecurityFilterContracts the subscription tracks. Options-only — the analytic silently ignores stock / index trades at the on_tick entry point.
conditionsConditionPolicyTrade-condition admission policy.
venuesExchangeFilterExchange / venue admission policy.
quantilef64Target 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(())
# }

Proprietary. All rights reserved.