Skip to content

Option Open Interest

Streams open-interest updates for one option contract. OPRA reports open interest each morning around 06:30 ET, reflecting the prior session; 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::Contract;
use thetadatadx::fpss::{FpssData, FpssEvent};

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

let sub = Contract::option("SPY", OptionLeg { expiration: "20260618", strike: "570", right: "C" })?.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.