Skip to main content
HIP-4 uses two distinct coin name formats to represent prediction market instruments. One format identifies an outcome at the AMM level and is used for price lookups. The other identifies a specific tradeable side within that outcome and is what you use when placing orders, reading order books, or querying fills. Understanding which format to use - and how the SDK’s helper functions convert between them - is essential for working with market data and the trading API.

The two coin formats

Outcome coin (@{outcomeId})

The @-prefixed coin represents an outcome at the AMM level. You use this format when fetching mid-market prices via allMids or when referencing a spot pair name. You do not use it for order placement.

Side coin (#{outcomeId}{sideIndex})

The #-prefixed coin is the tradeable instrument for a specific side of an outcome. This is what you pass to order placement, order book queries, and what appears in fill records. The outcome ID and side index are concatenated with no separator - #5160 means outcome 516, side 0.
The marketId field is always the outcome ID as a plain string - for example, "516". It is not a coin string. The outcome field is the side coin like "#5160".

Asset IDs

Hyperliquid’s order wire format uses numeric asset IDs, not coin strings. The SDK computes these for you, but it’s useful to understand the formulas. HIP-4 outcome sides:
For example, outcome 516, side 0:
Spot tokens (including USDC):
The two ranges don’t overlap, so the format tells you what kind of token you’re looking at.

Coin helper functions

Import the coin helpers from @outcome.xyz/hip4:

sideCoin(outcomeId, sideIndex)

Builds a side coin string from an outcome ID and side index.

sideAssetId(outcomeId, sideIndex)

Computes the numeric asset ID for use in order wire format.

parseSideCoin(coin)

Parses a side coin string back into its component parts.

outcomeCoin(outcomeId)

Builds an outcome coin string for AMM-level price lookups.

Side index conventions

sideIndex is always 0 or 1. By convention:
  • Side 0 is the first side - typically “Yes”, or the first named alternative (e.g. “Hypurr”)
  • Side 1 is the second side - typically “No”, or the second named alternative (e.g. “Usain Bolt”)
The actual side names come from sideSpecs in the outcome metadata and are resolved by the SDK automatically. You can read them from the typed market object:
For labelled binary markets, the names can be anything: