parse_chart_msg

Function parse_chart_msg 

Source
pub fn parse_chart_msg(
    chart_msg: &DeribitChartMsg,
    bar_type: BarType,
    price_precision: u8,
    size_precision: u8,
    ts_init: UnixNanos,
) -> Result<Bar>
Expand description

Parses a Deribit chart message from a WebSocket subscription into a [Bar].

Converts a single OHLCV data point from the chart.trades.{instrument}.{resolution} channel into a Nautilus Bar object.

ยงErrors

Returns an error if:

  • Price or volume values are invalid
  • Bar construction fails validation