Skip to main content

parse_generic_spread_id_legs

Function parse_generic_spread_id_legs 

Source
pub fn parse_generic_spread_id_legs(
    instrument_id: &InstrumentId,
) -> Result<Vec<(InstrumentId, i64)>>
Expand description

Parses a generic spread instrument ID into (instrument_id, ratio) legs.

Accepts the format new_generic_spread_id produces and returns the legs in the order they appear in the symbol, with a negative ratio for each ((ratio))symbol leg. Each ratio must be non-zero and contain only ASCII digits, so a sign inside the parentheses is rejected.

ยงErrors

Returns an error if: