Skip to content

DEX

Family: Flow surveillance

What it computes

Emits DexTick ticks carrying net_dex, call_dex, put_dex, strikes_used off chain + OI + spot.

Available on the live, historical, and replay drives.

Methodology

Dealer delta-exposure aggregator: Sum ±Δ_i × OI_i × multiplier × spot across chain.

See the methodology overview for the citation index.

Inputs

Chain + OI + spot.

Key outputs

Net_dex, call_dex, put_dex, strikes_used. The full field set is in the tick table below.

Output schema (DexTick)

The field / type / description table below is regenerated from the DexTick 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 underlying contract metadata.
datei32Trading-session date in YYYYMMDD form.
ms_of_dayi32Milliseconds-of-day of the emission.
spotf64Spot price used to scale each contribution.
net_dexf64Net delta exposure across every contributing contract.
call_dexf64Sum of call-side delta exposures (positive under the dealer convention — dealers are net long calls, and call delta is positive).
put_dexf64Sum of put-side delta exposures (positive — dealers are net short puts, and the short side of a negative-delta contract carries positive delta).
strikes_usedu32Number of (expiration, strike, right) triples that contributed (i.e. had a resolved Δ and an OI hit).

Configuration (DexParams)

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

FieldTypeDescription
contractsSecurityFilterContracts the subscription tracks. Typically a [SecurityFilter::Symbols] entry naming the underlying roots.
rateArc<dyn RateService>Risk-free rate provider, shared with the Greeks analytic.
calendarArc<dyn MarketCalendar>Market calendar provider, shared with the Greeks analytic.
annual_dividendOption<f64>Annual continuously compounded dividend yield. None (default) treats the underlying as non-dividend-paying.
dividend_cache`std::sync::Arc<crate::reference_data::dividend_yield::
DividendYieldCache>`Engine-wired per-symbol dividend-yield cache. Seated at subscribe time by DefaultSpec via wire_dividend_yield. Consulted on the dispatch path only when annual_dividend is None — the per-tick lookup resolves the continuous-dividend carry yield q = D / S from the live underlying spot the analytic already holds (O(1), lock-light, non-blocking). An explicit annual_dividend override always wins.
oi_cacheArc<OpenInterestCache>Engine-wide Option open-interest cache.
spot_cacheSpotPriceCacheShared underlying-spot cache.
contract_multiplierf64Contract multiplier. Default 100.0 for US-listed equity options.
min_emit_interval_msi64Minimum interval between emissions, in milliseconds. Defaults to 1_000 (one snapshot per second).
conditionsConditionPolicyTrade-condition admission policy applied to option NBBO quotes.
venuesExchangeFilterExchange / venue admission policy applied to option NBBO quotes.
iv_cacheIvCacheConfigIV reuse thresholds for the per-contract Greek recompute — the same drift policy the Greeks analytic applies. When the (option_mid, spot) pair drifts below both thresholds the bisection IV solve is skipped and the Greek is recomputed in closed form from the cached IV; the solver dominates per-quote cost, so the reuse path carries the steady-state throughput. [IvCacheConfig::off] re-solves on every quote.

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

Rust

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

use kairos::{Client, DexRow};

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

let sub = client
    .live()
    .dex(["SPX"])
    .on_event(|row: &DexRow| {
        println!("net_dex={} spot={}", row.net_dex, row.spot)
    })?;
// ... later ...
sub.unsubscribe();
# Ok(())
# }

Proprietary. All rights reserved.