Skip to main content

parse_outcome_instruments

Function parse_outcome_instruments 

Source
pub fn parse_outcome_instruments(
    meta: &OutcomeMeta,
) -> Result<Vec<HyperliquidInstrumentDef>, String>
Expand description

Parse outcome instrument definitions from Hyperliquid outcomeMeta response.

Each OutcomeMarket yields two definitions, one per side (0 and 1), modeled as binary outcome side tokens. The Nautilus internal symbol uses the form {outcome_index}-{YES|NO}-OUTCOME (symmetric with -PERP / -SPOT), and the wire raw_symbol uses the spot-coin form (#<encoding>) which is what l2Book, trades, and bbo subscriptions accept.

Expiry is read from the market’s own description when it carries class:priceBinary; for outcomes that point at a parent question (other or index:N), the expiry is inherited from that question’s description.

side_name is taken from the venue’s sideSpecs entry when present, otherwise it falls back to the canonical HIP-4 labels ("Yes" / "No").