Skip to content

OptionFlow

Preview on the public Rust client. The analytic ships in the engine and is reachable today through the Python wheel and the TypeScript / Node addon; a per-analytic builder on the public Rust thin client (kairos::Client) is tracked on the roadmap. The output tick schema below is stable.

What it computes

Per-bucket aggregated option flow over the admitted print stream: buy / sell / mid volume, buy / sell / mid premium, side-classified through the configured SideClassification (Lee–Ready, tick-rule, or quote-rule).

Methodology

Lee, C.M.C. & Ready, M.J. (1991), Inferring Trade Direction from Intraday Data, Journal of Finance 46(2): 733–746. The Lee–Ready aggressor classifier reads QuoteLabel::PreTrade by default per Lee & Ready 1991 §II.B. See /methodology/lee-ready.

Inputs

  • Option TradeTick.
  • The pre-trade NBBO snapshot for the same contract.

Output schema (OptionFlowTick)

The field / type / description table below is regenerated from the OptionFlowTick 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. Subscribers identify the security by (symbol, expiration, right, strike) on this field — the wire-level contract id is engine-internal and is not surfaced here.
datei32Trading-session date in YYYYMMDD form.
timeframeTimeframeBucket period this snapshot covers.
bucket_start_msi64Inclusive start of the bucket in milliseconds since midnight.
bucket_end_msi64Exclusive end of the bucket in milliseconds since midnight.
closedbooltrue if the bucket is closed (one tick per close on EmitPolicy); false for an intra-bucket partial snapshot on EmitPolicy.
countu32Total trade count in the bucket.
total_volumeu64Total volume in the bucket (contracts).
total_premiumf64Total premium in the bucket (USD).
buy_volumeu64Buyer-initiated volume (contracts).
sell_volumeu64Seller-initiated volume (contracts).
mid_volumeu64Mid-classified volume (contracts).
buy_premiumf64Buyer-initiated premium (USD).
sell_premiumf64Seller-initiated premium (USD).
mid_premiumf64Mid-classified premium (USD).
net_directionalf64Net directional premium: buy_premium − sell_premium.
tick_rule_resolved_buysu32At-mid prints resolved by the tick-rule fallback.
tick_rule_resolved_sellsu32At-mid prints resolved by the tick-rule fallback.
tick_rule_unresolvedu32At-mid prints that fell through to the tick-rule fallback and could not be resolved (no prior different price). Stays in mid_* totals.

Configuration (OptionFlowRequest)

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

FieldTypeDescription
contractsSecurityFilterContracts the subscription tracks. Typically a [SecurityFilter::Symbols] entry naming the underlying roots — the engine expands the symbol set into the per-contract option universe via the chain-enumeration path.
timeframeTimeframeBucket period. Defaults to [Timeframe::M1]; common alternatives are [Timeframe::S1] (high-frequency flow) and [Timeframe::S5] (smoothed mid-frequency).
emitEmitPolicyWhether the analytic emits one tick per closed bucket ([EmitPolicy::OnClose]) or after every admitted trade ([EmitPolicy::OnEveryTick]).
conditionsConditionPolicyTrade-condition admission policy. Defaults to [ConditionPolicy::OpraRegular] — cancels are excluded, late prints are admitted with the late flag set, and asterisk-condition trades are demoted to volume-only.
venuesExchangeFilterExchange / venue admission policy. Defaults to [ExchangeFilter::Any] — the SIP-consolidated tape.
classificationSideClassificationSide-classification policy applied to every admitted trade.
reference_quote_labelQuoteLabelQuote-cycle position cached as the Lee-Ready reference NBBO. Defaults to [QuoteLabel::PreTrade] per Lee & Ready (1991) §II.B; the alternatives are documented as research-mode A-B controls.

Operational characteristics

  • Per-tick latency. One side classification, one bucket update.
  • Allocation discipline. No hot-path heap allocations; running totals use NeumaierSum.
  • Replay parity. Deterministic given identical input tick order.

Example

Preview. This analytic ships in the engine and is reachable today through the Python wheel and the TypeScript / Node addon. A per-analytic builder on the public Rust thin client (kairos::Client) is tracked on the roadmap — bare-string symbol filters passed to the analytic accessor will match the other analytics already exposed there. The output tick rows are stable and documented above.

Proprietary. All rights reserved.