Skip to content

Circuit Breaker Proximity

Family: Risk

What it computes

Emits CircuitBreakerProximityTick ticks carrying pct_to_L1 / L2 / L3, breach_level off daily-close cache.

Available on the live and replay drives. The historical drive fails closed with KAIROS_ERR_HISTORICAL_UNWIRED until the relevant cache is hydrated externally.

Methodology

NYSE Rule 7.12 / Cboe Rule 6.32 thresholds (-7% / -13% / -20%).

See the methodology overview for the citation index.

Inputs

Daily-close cache.

Key outputs

Pct_to_L1 / L2 / L3, breach_level. The full field set is in the tick table below.

Output schema (CircuitBreakerProximityTick)

The field / type / description table below is regenerated from the CircuitBreakerProximityTick Rust source by docs-site/scripts/inject-doc-tables.ts on every npm run docs:build. Do not hand-edit between the sentinels.

FieldTypeDescription
index_symbolArc<str>Index symbol the thresholds reference (interned).
datei32Trading session date (YYYYMMDD).
ms_of_dayi32Milliseconds since midnight at emission time.
last_pricef64Last admitted index print.
reference_pricef64Reference price — the prior-session close locked in at session open per NYSE Rule 7.12.
drawdown_pctf64Cumulative session drawdown vs. reference_price, in percent. Negative once the index trades below the prior close.
level_1_thresholdf64Level 1 threshold in price units (reference × (1 + L1_DRAWDOWN)).
level_2_thresholdf64Level 2 threshold in price units.
level_3_thresholdf64Level 3 threshold in price units.
pct_to_l1f64Signed percent distance to Level 1 (relative to last_price).
pct_to_l2f64Signed percent distance to Level 2.
pct_to_l3f64Signed percent distance to Level 3.
next_threshold&'static str"L1" / "L2" / "L3" / "None" — which level the tape would breach next on continued drawdown. "None" once every MWCB threshold has been breached.
breach_leveli32Deepest level currently breached. 0 when no breach; 1/2/3 for active breaches.

Configuration (CircuitBreakerProximityParams)

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

FieldTypeDescription
contractsSecurityFilterContracts the subscription tracks. Must select the configured index_symbol (default "SPX"); other symbols are silently ignored.
conditionsConditionPolicyTrade-condition admission policy.
venuesExchangeFilterExchange / venue admission policy.
daily_closeArc<DailyCloseCache>Boot-time hydrated history. Sealed for the lifetime of the subscription. The previous-session close for index_symbol must be present.
index_symbolArc<str>Symbol of the index the MWCB thresholds reference. Defaults to "SPX" per NYSE Rule 7.12. Operators can override to a proxy ("^GSPC", "SPY") when the canonical cash-index print is unavailable, with the caveat that the published thresholds remain SPX-anchored — a proxy reading is an estimator, not the regulatory truth.
emit_interval_msi32Minimum interval between emissions, in milliseconds. Defaults to 1_000 (one snapshot per second).

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

Rust

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

use kairos::{Client, CircuitBreakerProximityRow};

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

let sub = client
    .live()
    .circuit_breaker_proximity(["QQQ"])
    .on_event(|row: &CircuitBreakerProximityRow| {
        println!("drawdown_pct={} last_price={}", row.drawdown_pct, row.last_price)
    })?;
// ... later ...
sub.unsubscribe();
# Ok(())
# }

Proprietary. All rights reserved.