Skip to main content

encode_depth10

Function encode_depth10 

Source
pub fn encode_depth10(
    data: &[OrderBookDepth10],
) -> Result<RecordBatch, ArrowError>
Expand description

Encodes depth-10 snapshots as a display-friendly Arrow [RecordBatch].

Emits Float64 columns per level for prices and sizes, UInt32 columns per level for counts, a Utf8 instrument_id column, and Timestamp(Nanosecond) columns for event and init times. Mixed-instrument batches are supported. Precision is lost on the conversion to f64; use crate::arrow::book_depth10_to_arrow_record_batch_bytes for catalog storage.

Returns an empty [RecordBatch] with the correct schema when data is empty.

ยงErrors

Returns an [ArrowError] if the Arrow RecordBatch cannot be constructed.