Quick reference
| Market type | What to look up | Asset ID formula | Example |
|---|---|---|---|
| Standard perp | Coin index in the meta info response | index | BTC on mainnet is 0 |
| Builder-deployed perp | perp_dex_index and index_in_meta | 100000 + perp_dex_index * 10000 + index_in_meta | test:ABC on testnet: 100000 + 1 * 10000 + 0 = 110000 |
| Spot pair | spotInfo["index"] for the base/quote pair in spotMeta | 10000 + spotInfo["index"] | PURR/USDC with spot index 0 is 10000 |
| Token ID | Token identifier, separate from spot asset ID | Not the same as spot asset ID | HYPE mainnet token ID 150; mainnet spot ID 107 |
Standard perp asset IDs
For perpetual endpoints, asset should be the integer index of the coin in the meta info response. For example, the documentation lists BTC = 0 on mainnet.
This is the simplest case: no offset is added. If your bot resolves a perp by name, use the index returned in the perp metadata, not a token ID or a spot pair index.
Builder-deployed perp asset IDs
Builder-deployed perps use a different offset so they do not collide with standard perp indices. The documented formula is:
asset = 100000 + perp_dex_index * 10000 + index_in_meta
Builder-deployed perp names are in the format {dex}:{coin}. The documentation example is test:ABC on testnet, where perp_dex_index = 1 and index_in_meta = 0, producing:
100000 + 1 * 10000 + 0 = 110000
When implementing this, resolve both the builder perp's perp_dex_index and its index_in_meta before constructing the order payload. Do not send the raw {dex}:{coin} string as the asset field; the API expects the calculated integer.
Like what you're reading? Try it yourself โ this link supports ChartedTrader at no cost to you.
Create a Hyperliquid account โSpot asset IDs
Spot endpoints expect:
asset = 10000 + spotInfo["index"]
spotInfo is the object in spotMeta that matches the desired quote and base tokens. For example, if PURR/USDC has spot index 0, the spot asset ID is 10000.
Spot asset IDs are not token IDs. The documentation gives HYPE as an example of the distinction:
| Network | HYPE token ID | HYPE spot ID |
|---|---|---|
| Mainnet | 150 | 107 |
| Testnet | 1105 | 1035 |
Common mapping mistakes
- Using a token ID where a spot asset ID is expected.
- Using a standard perp index for a builder-deployed perp without adding the builder offset.
- Reusing mainnet IDs on testnet, or vice versa.
- Treating a spot pair index as a token ID.
Worked example
Suppose a bot needs to place three orders:
- Standard perp
BTCon mainnet, where themetaindex is0:
asset = 0
- Builder perp
test:ABCon testnet, whereperp_dex_index = 1andindex_in_meta = 0:
asset = 110000
- Spot pair
PURR/USDC, where thespotMetaindex is0:
asset = 10000
These examples use the values from the official documentation and are intended to show the formula structure, not live order results.
Source
Create a Hyperliquid account. This is a referral link; a commission may be earned if you sign up.Continue with Hyperliquid
Browse the Hyperliquid guide hub for the complete user journey.