Blog
Hyperliquid API SDK: read sub-account DEX states with getSubAccountsWithAllDexStates
December 5, 2026
A Hyperliquid master address can hold several sub-accounts, and each one can have balances on the default perp DEX and on named perp DEXes. The @siebly/hyperliquid-api SDK exposes getSubAccountsWithAllDexStates() on its RestClient. You pass a public master address and get those states, with no API key.
Install
npm install @siebly/hyperliquid-api
The script
The example uses a public master address and writes each sub-account, its DEX account values, and any non-zero spot balances.
import { RestClient …