Summary
hyperliquid/config.ts derives the coin/asset key for prediction market outcomes using a formula that produces a #-prefixed identifier (e.g. #<OUTCOME_ASSET_BASE + 10*outcomeId>). The live Hyperliquid allMids response uses an @-prefixed format (e.g. @N) for prediction market assets.
Impact
MEDIUM — if the adapter looks up mid prices from allMids using the #-derived key, lookups return undefined, silently producing stale or zero prices. This is distinct from #1646 (which concerns questions[].question being an int used for string slug construction).
Evidence
config.ts coin encoding: constructs keys with # prefix using OUTCOME_ASSET_BASE offset
- Live
allMids response keys for prediction market outcomes: use @N format where N is a numeric index
- The two key spaces do not overlap; a
#-keyed lookup into an @-keyed map always misses
Affected files
core/src/exchanges/hyperliquid/config.ts — OUTCOME_ASSET_BASE constant and coin key derivation
core/src/exchanges/hyperliquid/fetcher.ts — uses derived coin key to index into allMids
Fix direction
Audit the live allMids key format for prediction market coins and update the key derivation in config.ts to match. Confirm whether the formula should use @ prefix and what the index mapping is.
Summary
hyperliquid/config.tsderives the coin/asset key for prediction market outcomes using a formula that produces a#-prefixed identifier (e.g.#<OUTCOME_ASSET_BASE + 10*outcomeId>). The live HyperliquidallMidsresponse uses an@-prefixed format (e.g.@N) for prediction market assets.Impact
MEDIUM — if the adapter looks up mid prices from
allMidsusing the#-derived key, lookups returnundefined, silently producing stale or zero prices. This is distinct from #1646 (which concernsquestions[].questionbeing an int used for string slug construction).Evidence
config.tscoin encoding: constructs keys with#prefix usingOUTCOME_ASSET_BASEoffsetallMidsresponse keys for prediction market outcomes: use@Nformat where N is a numeric index#-keyed lookup into an@-keyed map always missesAffected files
core/src/exchanges/hyperliquid/config.ts—OUTCOME_ASSET_BASEconstant and coin key derivationcore/src/exchanges/hyperliquid/fetcher.ts— uses derived coin key to index intoallMidsFix direction
Audit the live
allMidskey format for prediction market coins and update the key derivation inconfig.tsto match. Confirm whether the formula should use@prefix and what the index mapping is.