> ## Documentation Index
> Fetch the complete documentation index at: https://goldrush.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# subAccounts | Hyperliquid Info API

> Hyperliquid subAccounts: fetch a master wallet's sub-accounts along with their full perp and spot state in a single call.

<CardGroup cols={2}>
  <Card title="Credit Cost"> 1 per call</Card>
  <Card title="Processing"> Realtime</Card>
</CardGroup>

The Hyperliquid info endpoint with `type: "subAccounts"` is used to fetch a master wallet's sub-accounts along with their full perp and spot state in a single call.

<Tip>
  Estimate your monthly cost for this API using the [Pricing Calculator](/pricing-calculator?endpoint=%2Fapi-reference%2Fhyperliquid-info%2Fsub-accounts).
</Tip>

<Info>
  * Wire-equal to `POST api.hyperliquid.xyz/info` with `{"type": "subAccounts", "user": "..."}`.
  * For per-sub-account real-time updates, subscribe to <a href="https://goldrush.dev/docs/api-reference/streaming-api/subscriptions/wallet-activity-stream" target="_blank" rel="noopener noreferrer">`walletTxs`</a> on each `subAccountUser` returned here.
  * For multi-wallet polling without traversing master/sub-account hierarchy, see <a href="https://goldrush.dev/docs/api-reference/hyperliquid/batch-clearinghouse-state" target="_blank" rel="noopener noreferrer">`batchClearinghouseState`</a> and <a href="https://goldrush.dev/docs/api-reference/hyperliquid/batch-spot-clearinghouse-state" target="_blank" rel="noopener noreferrer">`batchSpotClearinghouseState`</a>.
</Info>

Returns the sub-accounts owned by a master wallet, with each sub-account’s perp [clearinghouseState](https://goldrush.dev/docs/api-reference/hyperliquid/clearinghouse-state) and spot [spotClearinghouseState](https://goldrush.dev/docs/api-reference/hyperliquid/spot-clearinghouse-state) inlined per slot - so a single call returns the full balance picture across the master plus its sub-accounts.

User-keyed. The result is `null` for wallets that aren’t master accounts.

## Endpoint

```
POST https://hypercore.goldrushdata.com/info
Authorization: Bearer <GOLDRUSH_API_KEY>
Content-Type: application/json
```

## Request

<ParamField body="type" type="string" required>
  Always `"subAccounts"`.
</ParamField>

<ParamField body="user" type="string" required>
  The master wallet address (lowercase 0x-prefixed hex).
</ParamField>

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://hypercore.goldrushdata.com/info \
    -H "Authorization: Bearer $GOLDRUSH_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "subAccounts",
      "user": "0x2ba553d9f990a3b66b03b2dc0d030dfc1c061036"
    }'
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch("https://hypercore.goldrushdata.com/info", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.GOLDRUSH_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      type: "subAccounts",
      user: "0x2ba553d9f990a3b66b03b2dc0d030dfc1c061036",
    }),
  });

  const subAccounts = await response.json();
  ```

  ```python Python theme={null}
  import os, requests

  response = requests.post(
      "https://hypercore.goldrushdata.com/info",
      headers={"Authorization": f"Bearer {os.environ['GOLDRUSH_API_KEY']}"},
      json={
          "type": "subAccounts",
          "user": "0x2ba553d9f990a3b66b03b2dc0d030dfc1c061036",
      },
  )

  sub_accounts = response.json()
  ```
</CodeGroup>

## Response

An array of sub-account objects, or `null` if the queried wallet is not a master account.

```json theme={null}
[
  {
    "name": "trading-bot-1",
    "subAccountUser": "0x2b804617c6f63c040377e95bb276811747006f4b",
    "master": "0x2ba553d9f990a3b66b03b2dc0d030dfc1c061036",
    "clearinghouseState": {
      "marginSummary": {
        "accountValue": "5000.00",
        "totalNtlPos": "0.0",
        "totalRawUsd": "5000.00",
        "totalMarginUsed": "0.0"
      },
      "crossMarginSummary": {
        "accountValue": "5000.00",
        "totalNtlPos": "0.0",
        "totalRawUsd": "5000.00",
        "totalMarginUsed": "0.0"
      },
      "crossMaintenanceMarginUsed": "0.0",
      "withdrawable": "5000.00",
      "assetPositions": [],
      "time": 1735689600000
    },
    "spotState": {
      "balances": [
        { "coin": "USDC", "token": 0, "hold": "0.0", "total": "1000.00", "entryNtl": "1000.00" }
      ]
    }
  }
]
```

### Field descriptions

<ResponseField name="name" type="string">
  Optional human-readable label assigned to the sub-account.
</ResponseField>

<ResponseField name="subAccountUser" type="string">
  The sub-account's wallet address (0x-prefixed hex).
</ResponseField>

<ResponseField name="master" type="string">
  The master wallet address that owns this sub-account.
</ResponseField>

<ResponseField name="clearinghouseState" type="object">
  Perp account state for this sub-account. Identical shape to the single-wallet [`clearinghouseState`](/api-reference/hyperliquid-info/clearinghouse-state) response - margin summaries, asset positions, withdrawable balance, snapshot timestamp.
</ResponseField>

<ResponseField name="spotState" type="object">
  Spot account state for this sub-account. Identical shape to the single-wallet [`spotClearinghouseState`](/api-reference/hyperliquid-info/spot-clearinghouse-state) response - per-token balances and the optional `tokenToAvailableAfterMaintenance` array.
</ResponseField>

*Last reviewed: 2026-06-13*
