Skip to content

[RFC] Hyperliquid HIP-4 outcome markets integration #4031

Description

@graceyangfan

Description

Context

NautilusTrader has an official Hyperliquid integration (spot/perps), but it does not currently support Hyperliquid predicted markets (HIP-4 outcome markets).

Hyperliquid exposes outcome market metadata via POST /info with { "type": "outcomeMeta" }.

Hyperliquid also documents the outcome asset encoding:

  • encoding = 10 * outcome + side
  • outcome market coin: #<encoding>
  • outcome action asset id: 100_000_000 + encoding

This RFC proposes adding official adapter support for outcome markets:

  • instrument discovery + model mapping
  • market data subscriptions (quotes/trades/order book where available)
  • order entry/cancel for outcome assets
  • recurring market refresh / rotation support

Why?

  • Outcome markets are a new instrument class not covered by spot/perps.
  • The metadata endpoint + asset encoding are documented and appear stable enough to integrate behind an opt-in flag.
  • Recurring markets (daily / 15m / etc.) are a good fit for systematic strategies, but require correct rotation handling.

Proposed Scope

Instruments

  • Add HyperliquidProductType.OUTCOME as an opt-in product type for Hyperliquid data/execution clients.

  • Load outcome instrument definitions from outcomeMeta.

  • Map outcomes to BinaryOption instruments with a stable InstrumentId scheme:

    • OUTCOME-{outcome_id}-{YES|NO}-OUTCOME.HYPERLIQUID
  • Persist the raw-symbol and action-asset mapping per docs:

    • raw_symbol = #<encoding> where encoding = outcome_id * 10 + side
    • asset_id = 100_000_000 + encoding
  • Parse the description strings into structured metadata, and attach it to BinaryOption.info (e.g. class, underlying, period, expiry, targetPrice, priceThresholds, etc.).

Market data

  • Enable WS subscriptions for outcomes (BBO/trades/book where supported for #<encoding> coins).

Execution

  • Enable order submit/cancel/modify for outcome assets using the documented action-asset encoding.

Rotation / refresh

Recurring predicted markets can rotate in two ways:

  1. Recycled parameters: the tradable InstrumentId remains stable, but the expiry/threshold metadata changes after expiry.
  2. Active outcome id changes: for categorical questions (e.g. priceBucket with 3 named outcomes) the active tradable outcomes may change to new outcome IDs each period.

Propose:

  • An adapter-level configuration option to refresh outcome instrument definitions aligned to the next known expiry (rather than fixed-interval polling).
  • A documented strategy pattern (and/or helper) to “select active instrument by key” and re-subscribe when the active InstrumentId changes.

Non-goals (initially)

  • Historical quotes/trades for outcomes (if the venue doesn’t provide it).
  • Guaranteeing deep liquidity / continuous quotes for outcomes.

Considerations

  • Hyperliquid docs have historically labeled outcomeMeta as testnet-only; the integration should be opt-in and degrade gracefully if unavailable.
  • Examples/tests should not assume outcome quotes always stream continuously.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions