Skip to main content
An AssetId is Notional’s code for a specific asset or market. Clients use Notional AssetIds even when an order is executed through Hyperliquid or Polymarket.

Encoding

Every AssetId starts with a four-character type prefix. The characters after that prefix identify the specific market or asset. In the formulas below, hex(value, width) means converting value to lowercase hexadecimal and adding leading zeroes until the result contains width characters. The examples below use the unprefixed format accepted by order actions and returned by market metadata. Protocol-transfer endpoints use the same bytes with a 0x prefix.

Hyperliquid Perpetuals

For a perpetual in Hyperliquid’s default meta.universe, use the market’s array index.
The 0002 prefix identifies a Hyperliquid perpetual in the default perp universe. It does not apply to HIP-3 markets. Index 0 produces 00020000, index 1 produces 00020001, and index 7 produces 00020007.

Hyperliquid HIP-3 Perpetuals

First calculate Hyperliquid’s HIP-3 venue index, then encode it as a six-byte integer.
For example, dexIndex = 188 and indexInDex = 0 produce venue index 1980000 and AssetId 00050000001e3660.

Hyperliquid Spot Tokens

Use the token’s index in Hyperliquid’s spotMeta.tokens with Notional’s 10000 offset.
The 0001 prefix identifies a Hyperliquid spot token. For example, token index 0 produces 00012710.

Hyperliquid Spot Pairs

Use the pair’s index in Hyperliquid’s spotMeta.universe.
The 0003 prefix identifies a Hyperliquid spot pair. For example, spot-pair index 1 produces 00030001.

Hyperliquid Outcomes

Each outcome side is derived from its outcome ID and side index. Side index 0 is Yes and side index 1 is No.
For example, outcome 10218, side 0, produces hlEncoding = 100102180 and AssetId 0004000005f77024.

Polymarket Outcomes

Given a decimal Polymarket token ID, encode it as a 32-byte integer after the 1001 type prefix:
The equivalent JavaScript is:
Use a decimal token ID with no sign, whitespace, or leading zeroes.

Polygon and HyperEVM Assets

EVM AssetIds contain a four-character chain prefix, a two-character asset kind, and a 40-character locator.
  • Polygon uses chain type 8001; HyperEVM uses 8002.
  • Native assets use kind 00 and a locator of 20 zero bytes.
  • ERC-20 assets use kind 01 and the contract address, without 0x, as the locator.