Skip to main content

spotMeta

Get metadata for all available spot trading assets on Hyperliquid, including token details, decimal precision, and trading pair information.

When to Use This Endpoint#

The spotMeta endpoint is essential for:

  • Spot Trading Interfaces — Display available spot markets with correct token information
  • Token Discovery — List all tradeable spot assets
  • Decimal Handling — Format token amounts with correct precision
  • Token Validation — Verify token addresses and canonical status

Request#

Endpoint#

POST https://api-hyperliquid-mainnet-info.n.dwellir.com/info

Headers#

HeaderValueRequired
Content-Typeapplication/jsonYes
X-Api-KeyYour API keyYes

Parameters#

ParameterTypeRequiredDescription
typestringYesMust be "spotMeta"

Example Request#

{
"type": "spotMeta"
}

Response#

Success Response#

{
"universe": [
{
"tokens": [0, 1],
"name": "USDC/USDT"
}
],
"tokens": [
{
"name": "USDC",
"szDecimals": 8,
"weiDecimals": 8,
"index": 0,
"tokenId": "0x6d1e7cde53ba9467b783cb7c530ce054",
"isCanonical": true,
"fullName": "USD Coin"
},
{
"name": "USDT",
"szDecimals": 8,
"weiDecimals": 8,
"index": 1,
"tokenId": "0x4ed5f9b9547c4fbb52be8b24fcb5e8ba",
"isCanonical": true,
"fullName": "Tether USD"
}
]
}

Response Fields#

FieldTypeDescription
universearrayArray of spot trading pair objects
tokensarrayArray of token metadata objects

Token Object#

FieldTypeDescription
namestringToken symbol (e.g., "USDC")
szDecimalsintegerDecimal places for size formatting
weiDecimalsintegerDecimal places for wei conversions
indexintegerUnique token index
tokenIdstringUnique token identifier
isCanonicalbooleanWhether the token is canonical
fullNamestringFull token name

Code Examples#

curl -X POST 'https://api-hyperliquid-mainnet-info.n.dwellir.com/info' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"type":"spotMeta"}'

Common Use Cases#

1. Format Token Amounts#

function formatTokenAmount(tokenName, amount, spotMeta) {
const token = spotMeta.tokens.find(t => t.name === tokenName);
if (!token) return amount.toString();

return amount.toFixed(token.szDecimals);
}

// Usage
const spotMeta = await getSpotMeta();
console.log(formatTokenAmount('USDC', 1000.123456, spotMeta)); // "1000.12345600"

2. Build Token Selector#

async function getTokenList() {
const spotMeta = await getSpotMeta();

return spotMeta.tokens
.filter(t => t.isCanonical)
.map(token => ({
symbol: token.name,
fullName: token.fullName,
tokenId: token.tokenId,
decimals: token.szDecimals
}));
}

3. Validate Token#

function isValidToken(tokenName, spotMeta) {
return spotMeta.tokens.some(t => t.name === tokenName);
}

Best Practices#

  1. Cache spot metadata for extended periods as it changes infrequently
  2. Use correct decimals when formatting token amounts
  3. Filter canonical tokens when presenting token lists to users
  4. Validate tokens before attempting trades

Access Hyperliquid spot market metadata with Dwellir's HyperCore Info Endpoint. Get your API key →