Skip to content

Option Full Open Interest

Streams the morning open-interest reports for every option contract — one subscription covering the entire OPRA universe. Each report delivers an OpenInterest event.

The snippets below assume a connected client with streaming started — see Getting Started for the connect-and-stream ladder.

rust
use thetadatadx::fpss::protocol::SecTypeExt;
use thetadatadx::fpss::{FpssData, FpssEvent};
use thetadatadx::SecType;

tdx.start_streaming(|event: &FpssEvent| {
    if let FpssEvent::Data(FpssData::OpenInterest { contract, open_interest, .. }) = event {
        println!("{} oi={open_interest}", contract.symbol);
    }
})?;

let sub = SecType::Option.full_open_interest();
tdx.subscribe(sub.clone())?;

// Remove this stream; the session stays open for other subscriptions.
tdx.unsubscribe(sub)?;

Event fields

Each update arrives as a OpenInterest event with these fields:

FieldTypeDescription
contractcontractResolved contract identity (symbol, security type, and option fields).
ms_of_dayi32Milliseconds since midnight Eastern Time.
open_interesti32Total outstanding contracts.
datei32Trading date as a YYYYMMDD integer.
received_at_nsu64Local receive timestamp, nanoseconds since the Unix epoch.

The contract field carries symbol, the security type, and — for options — expiration, right, and the strike. See Handling Events for the full event catalogue and per-language field shapes.

Released under the Apache-2.0 License.