Skip to main content

Module instrument

Module instrument 

Source
Expand description

Display-mode Arrow encoder for [InstrumentAny].

Emits a single schema built from the common [Instrument] trait surface, plus the dated/option accessors (strike_price, activation_ns, expiration_ns, option_kind) that are uniformly reachable across variants. Variants that do not expose a given accessor emit a null for that row, so mixed-type instrument batches (spot, perp, future, option, equity, etc.) flow through one Perspective table.

Variant-only metadata that is not reachable through the trait (e.g. BettingInstrument::market_id, BinaryOption::outcome, FuturesSpread::strategy_type) is intentionally not emitted. Consumers that need those fields should encode the concrete variant through the FixedSizeBinary encoders in the parent crate::arrow module.

Functionsยง

encode_instruments
Encodes instruments as a display-friendly Arrow [RecordBatch].
instrument_schema
Returns the display-mode Arrow schema for [InstrumentAny].