parse_perp_instruments

Function parse_perp_instruments 

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

Parse perpetual instrument definitions from Hyperliquid meta response.

Hyperliquid perps follow specific rules:

  • Quote is always USD (USDC settled)
  • Price decimals = max(0, 6 - sz_decimals) per venue docs
  • Active = !is_delisted

Important: Delisted instruments are included in the returned list but marked as inactive. This is necessary to support parsing historical data (orders, fills, positions) for instruments that have been delisted but may still have associated trading history.