Exchange
hyperliquid
Drift Type
changed_response
Severity
CRITICAL — all HIP-4 prediction market mid-price lookups silently return undefined
Their Docs
The allMids endpoint (POST /info { type: "allMids" }) returns a map keyed by asset identifier. For HIP-4 prediction market outcomes the key format is #N where N = 10 * outcomeId + sideIndex (e.g., #80 for outcome 8 Yes side, #81 for No side). The # prefix identifies outcome markets; @ prefix identifies spot pairs.
Source: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api (allMids section + QuickNode Hyperliquid API guide)
Our Cached Spec
core/src/exchanges/hyperliquid/utils.ts — toMidKey() function returns `@${outcomeId}` (e.g., @8). This is the spot pair format. The function is called in the normalizer to look up mid prices from the allMids response.
File: core/src/exchanges/hyperliquid/utils.ts (toMidKey helper)
callApi() References at Risk
None (Hyperliquid uses direct POST calls, not callApi)
Hardcoded URL Bypasses
All info calls go to POST ${baseUrl}/info at fetcher.ts:163
Impact
fetchMarkets() and fetchEvents() look up mid prices by calling allMids[toMidKey(outcomeId)]. Because toMidKey returns @8 but the response contains keys like #80, every lookup returns undefined. All markets show undefined / NaN mid-prices instead of real values.
Fix: toMidKey should return `#${outcomeId * 10}` for the Yes side mid.
Found by automated spec drift audit
Exchange
hyperliquid
Drift Type
changed_response
Severity
CRITICAL — all HIP-4 prediction market mid-price lookups silently return
undefinedTheir Docs
The
allMidsendpoint (POST /info { type: "allMids" }) returns a map keyed by asset identifier. For HIP-4 prediction market outcomes the key format is#Nwhere N =10 * outcomeId + sideIndex(e.g.,#80for outcome 8 Yes side,#81for No side). The#prefix identifies outcome markets;@prefix identifies spot pairs.Source: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api (allMids section + QuickNode Hyperliquid API guide)
Our Cached Spec
core/src/exchanges/hyperliquid/utils.ts—toMidKey()function returns`@${outcomeId}`(e.g.,@8). This is the spot pair format. The function is called in the normalizer to look up mid prices from theallMidsresponse.File:
core/src/exchanges/hyperliquid/utils.ts(toMidKey helper)callApi() References at Risk
None (Hyperliquid uses direct POST calls, not callApi)
Hardcoded URL Bypasses
All info calls go to
POST ${baseUrl}/infoatfetcher.ts:163Impact
fetchMarkets()andfetchEvents()look up mid prices by callingallMids[toMidKey(outcomeId)]. BecausetoMidKeyreturns@8but the response contains keys like#80, every lookup returnsundefined. All markets showundefined/NaNmid-prices instead of real values.Fix:
toMidKeyshould return`#${outcomeId * 10}`for the Yes side mid.Found by automated spec drift audit