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:
- The symbol does not contain
GENERIC_SPREAD_ID_SEPARATOR. - A leg is not in the
(ratio)symbolor((ratio))symbolformat.