Skip to content

Response drift: hyperliquid — coin key formula in config.ts uses # prefix; live allMids uses @ prefix for prediction markets #2133

Description

@realfishsam

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.tsOUTCOME_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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions