Skip to main content
Fetch asset details, prices, OHLCV chart data, and orderbook snapshots.
The examples on this page use Hyperliquid (provider: 'hyperliquid'). Replace the provider value with any supported DEX from getProviders().

getAssets

Returns the token/asset registry for a specified DEX — the base entities referenced by markets (as base/quote legs) and by account balances. Static market metadata (leverage, margin) lives on Market via getMarkets; live data (mark price, funding) lives on MarketContext via getMarketsContext.

Parameters

Returns

AssetsResponse{ assets: Asset[] }: Each Asset: API Reference: GET /assets

getMarkets

Returns all tradeable markets for a specified DEX as static instrument metadata — ids, base/quote assets, decimals, leverage, and margin. Live data (mark price, funding, open interest, volume) comes from getMarketsContext.

Parameters

Returns

MarketsResponse{ markets: Market[] }. A Market is either a PerpsMarket or a SpotMarket; both extend BaseMarket: PerpsMarket adds: Live per-market data (mark price, previous-day price, 24h volume, open interest, funding) comes from getMarketsContext. API Reference: GET /markets

getMarket

Returns a single market by its canonical marketId.

Parameters

Returns

Market — single market object (same shape as above). API Reference: GET /markets

Default market

DEFAULT_MARKET_ID gives the market a caller lands on when it names none, keyed by provider and given as the venue’s own Market.id:
getDefaultMarketId(provider: DefaultMarketProvider): string reads a single provider’s default market id from DEFAULT_MARKET_ID. DefaultMarketProvider is 'hyperliquid' | 'lighter' | 'ondo'. Each value is a fixed deployment fact, so it needs no runtime lookup.

getMarketsContext

Returns live per-market context for all markets: midPrice, markPrice, and (where the venue publishes it) oraclePrice; prevDayPrice, priceChange24h, and volume24h for every market; marketCap where the venue publishes circulating supply; and openInterest and funding for perps. Intended for frequent polling; pair it with the static metadata from getMarkets.

Parameters

Returns

PricesResponse{ prices: MarketContext[] }: Each MarketContext: API Reference: GET /marketsContext

getOhlcv

Returns OHLCV candle data for charts.

Parameters

Returns

OhlcvResponse: Each Candle: API Reference: GET /ohlcv

getOrderbook

Returns current orderbook snapshot with bids and asks.

Parameters

Returns

OrderbookResponse: Each OrderbookLevel: API Reference: GET /orderbook

getMeta

Get platform metadata: the backend version and the list of active platform-level notices. Provider-independent — reads the platform meta surface, so it takes no provider.

Parameters

Returns

Meta{ version: string; notices: Notice[] }. API Reference: GET /meta

getTermsAcceptance

Get the current terms-of-service document (version + full content) and whether a given address has accepted that version. Provider-independent — reads the platform meta surface.

Parameters

Returns

TermsAcceptanceStatus{ termsVersion: string; content: string; accepted: boolean; acceptedAt?: number }. API Reference: GET /meta/terms

getReferralStatus

Get an address’s onboarding and internal-referral state: terms acceptance, its attached and owned codes, whether it may create a code, and the verdict on a candidate code. Provider-independent — reads the platform meta surface.

Parameters

Returns

ReferralStatus{ address, termsVersion, termsAccepted, attachedCode?, ownedCode?, ownedCodeEligibility, candidate?, onboarding? }. An address the backend holds no record for resolves to termsAccepted: false with the optional fields absent.

Referral code validation

candidate is a ReferralCodeValidation verdict on the code query param: { code, valid, normalizedCode?, rejection? }. code echoes the candidate, valid reports whether the backend accepts it, normalizedCode carries the backend’s canonical form when it differs from code, and rejection names the reason when valid is false. rejection is a ReferralCodeRejection value:

getReferralActivity

Get the addresses attached to address’s owned internal referral code, paginated. Provider-independent — reads the platform meta surface.

Parameters

Returns

ReferralActivityResponse{ items: ReferralActivityItem[]; pagination: Pagination }. Each item is { address, attachedAt, notional }. An address that owns no code resolves to items: [].