The examples on this page use Hyperliquid (
provider: 'hyperliquid'). Replace the provider value with any supported DEX from getProviders().getAssets
Returns all tradeable assets for a specified DEX with funding rates, open interest, and volume.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
client | PerpsSDKClient | Yes | SDK client |
params.provider | string | Yes | Provider identifier |
options | SDKRequestOptions | No | Request options |
Returns
AssetsResponse — { assets: Asset[] }:
Each Asset:
| Field | Type | Description |
|---|---|---|
assetId | string | Provider’s canonical identity (e.g., "BTC", "xyz:PURR", "@142") |
market | string | Market category (e.g., "hyperliquid", "xyz", "spot") |
displaySymbol | string | UI-friendly base symbol (e.g., "BTC", "PURR") |
displayQuote | string | null | Quote asset (e.g., "USDC") |
displayName | string? | Full asset name (e.g., "Bitcoin") |
logoURI | string | URL to asset logo |
szDecimals | number | Size decimal places |
maxLeverage | number | Maximum allowed leverage |
onlyIsolated | boolean | Whether only isolated margin is supported |
isMarginCollateral | boolean? | Whether this asset can be used as margin collateral |
funding | FundingInfo | Current funding rate and next funding time |
openInterest | string? | Total open interest in USD |
volume24h | string? | 24-hour trading volume in USD |
prevDayPrice | string? | Previous day’s price |
markPrice | string | Current mark price |
getAsset
Returns details for a single asset.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
client | PerpsSDKClient | Yes | SDK client |
params.provider | string | Yes | Provider identifier |
params.symbol | string | Yes | Asset identifier (e.g., BTC) |
options | SDKRequestOptions | No | Request options |
Returns
Asset — Single asset object (same shape as above).
API Reference: GET /assets/
getPrices
Returns current mid prices for all assets. Lightweight endpoint for frequent polling.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
client | PerpsSDKClient | Yes | SDK client |
params.provider | string | Yes | Provider identifier |
params.symbols | string[] | No | Filter to specific asset IDs |
options | SDKRequestOptions | No | Request options |
Returns
PricesResponse — { prices: AssetPrice[] }:
Each AssetPrice:
| Field | Type | Description |
|---|---|---|
assetId | string | Asset identifier |
price | string | Current mid price |
getOhlcv
Returns OHLCV candle data for charts.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
client | PerpsSDKClient | Yes | SDK client |
params.provider | string | Yes | Provider identifier |
params.symbol | string | Yes | Asset identifier |
params.interval | string | Yes | Candle interval: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d, 3d, 1w, 1M |
params.startTime | number | No | Start timestamp in milliseconds |
params.endTime | number | No | End timestamp in milliseconds |
params.limit | number | No | Max candles to return (default 100, max 1000) |
options | SDKRequestOptions | No | Request options |
Returns
OhlcvResponse:
| Field | Type | Description |
|---|---|---|
provider | string | Provider identifier |
assetId | string | Asset identifier |
interval | string | Candle interval |
candles | Candle[] | Array of candle data |
Candle:
| Field | Type | Description |
|---|---|---|
t | number | Timestamp in milliseconds |
o | string | Open price |
h | string | High price |
l | string | Low price |
c | string | Close price |
v | string | Volume |
getOrderbook
Returns current orderbook snapshot with bids and asks.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
client | PerpsSDKClient | Yes | SDK client |
params.provider | string | Yes | Provider identifier |
params.symbol | string | Yes | Asset identifier |
params.depth | number | No | Number of price levels (default 20, max 100) |
options | SDKRequestOptions | No | Request options |
Returns
OrderbookResponse:
| Field | Type | Description |
|---|---|---|
provider | string | Provider identifier |
assetId | string | Asset identifier |
bids | OrderbookLevel[] | Bid price levels (descending) |
asks | OrderbookLevel[] | Ask price levels (ascending) |
timestamp | number | Snapshot timestamp in milliseconds |
OrderbookLevel:
| Field | Type | Description |
|---|---|---|
price | string | Price level |
size | string | Size at this price level |