Skip to main content

Module market

Module market 

Source
Expand description

The coin a Hyperliquid subscription names its market by.

§Which instrument to subscribe with

A MarketInstrumentData is subscribed by its name_exchange verbatim, so it works for every market. Build it with MarketInstrumentData::hyperliquid_perp or MarketInstrumentData::hyperliquid_spot from a HyperliquidMeta lookup.

A MarketDataInstrument (or one Keyed over it) derives the coin from its asset names, which are stored lower-cased, so the venue’s case is lost before the coin is built:

  • A perpetual’s coin is the base asset upper-cased. That is right for most perpetuals (BTC), but wrong for a mixed-case one (kPEPE becomes KPEPE) and for a builder-deployed (HIP-3) one, whose deployer is lower-case (xyz:TSLA becomes XYZ:TSLA).
  • A spot pair’s coin is BASE/QUOTE upper-cased, which names only PURR/USDC. Every other pair is named @{index}; pass that as the base asset (@107) to subscribe to it.

A wrong coin gets no data, and Hyperliquid then closes the connection, ending the other subscriptions on it too.

Structs§

HyperliquidMarket
The coin a Hyperliquid subscription names its market by (BTC, kPEPE, xyz:TSLA, @107, PURR/USDC).

Traits§

HyperliquidInstrument
An instrument representation a Hyperliquid subscription can name as a market, perpetual or spot.