Skip to main content

parse_option_summary_greeks

Function parse_option_summary_greeks 

Source
pub fn parse_option_summary_greeks(
    msg: &OKXOptionSummaryMsg,
    instrument_id: &InstrumentId,
    greeks_type: OKXGreeksType,
    ts_init: UnixNanos,
) -> Result<OptionGreeks>
Expand description

Parses an option summary payload into [OptionGreeks].

Selects Black-Scholes (delta_bs, gamma_bs, vega_bs, theta_bs) or price-adjusted (delta, gamma, vega, theta) greeks based on greeks_type. BS greeks align with what Deribit and Bybit provide; PA greeks are denominated in the underlying/coin units and match OKX’s native contract convention.

§Errors

Returns an error if any of the greeks or volatility fields cannot be parsed as f64.