Skip to content

Option Quotes

Streams every NBBO update for one option contract. Each change to the national best bid or offer delivers a Quote event to the registered callback.

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

rust
use thetadatadx::streaming::{Contract, OptionLeg};
use thetadatadx::streaming::{StreamData, StreamEvent};

client.stream().start_streaming(|event: &StreamEvent| {
    if let StreamEvent::Data(StreamData::Quote { contract, bid, ask, .. }) = event {
        println!("{} bid={bid} ask={ask}", contract.symbol);
    }
})?;

let sub = Contract::option("SPY", OptionLeg { expiration: "20260618", strike: "570", right: "C" })?.quote();
client.stream().subscribe(sub.clone())?;

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

Quote event fields

Each update arrives as a Quote event with these fields:

FieldTypeDescription
contractcontractResolved contract identity (symbol, security type, and option fields).
ms_of_dayi32Milliseconds since midnight Eastern Time.
bid_sizei32Last NBBO bid size.
bid_exchangei32Exchange code of the NBBO bid.
bidf64Last NBBO bid price.
bid_conditioni32Quote condition code on the bid side.
ask_sizei32Last NBBO ask size.
ask_exchangei32Exchange code of the NBBO ask.
askf64Last NBBO ask price.
ask_conditioni32Quote condition code on the ask side.
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.

WebSocket frame

The native SDK callbacks (Rust/Python/TypeScript/C++) receive every field above. Each raw WebSocket frame (the Server tab) is { "header": {…}, "contract": {…}, "quote": {…} }: header and contract are always present, while the quote payload object carries only the terminal-compatible subset: ms_of_day, bid_size, bid_exchange, bid, bid_condition, ask_size, ask_exchange, ask, ask_condition, date. The remaining event fields are delivered to the SDK callbacks, not the quote payload object.

Released under the Apache-2.0 License.