Skip to content

Index Market Value ​

Streams the market value for an index, delivered as an IndexMarketValue event carrying ms_of_day, market_price and date. An index has no NBBO, so there is no market_bid or market_ask beside the price and no midpoint between them: the event type is distinct from the stock and option MarketValue for that reason, rather than carrying fields that do not apply. The market price is the vendor's indicative figure: the index level moved by a random 1 to 5 cents up or down, never exact, as the vendor serves it on every surface. For the exact level, subscribe to the index price instead. Market value is a per-index subscription with no full-stream broadcast.

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

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

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

let sub = Contract::index("SPX").market_value();
client.stream().subscribe(sub.clone())?;

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

IndexMarketValue event fields ​

Each update arrives as a IndexMarketValue event with these fields:

FieldTypeDescription
contractcontractResolved contract identity (symbol, security type, and option fields).
ms_of_dayi32Milliseconds since midnight Eastern Time.
market_pricef64Calculated market value; the only populated value for an index.
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": {…}, "market_value": {…} }: header and contract are always present, while the market_value payload object carries only the terminal-compatible subset: ms_of_day, market_price, date. The remaining event fields are delivered to the SDK callbacks, not the market_value payload object.

Released under the Apache-2.0 License.