> ## 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.

# clearinghouseState | Hyperliquid Info API

> Hyperliquid clearinghouseState: fetch a single user's perpetuals account state by wallet address.

> [card] Credit Cost
>
> 1 per call

> [card] Processing
>
> Realtime

The Hyperliquid info endpoint with `type: "clearinghouseState"` is used to fetch a single user's perpetuals account state by wallet address.

> [!TIP]
>
> Estimate your monthly cost for this API using the [Pricing Calculator](https://goldrush.dev/docs/pricing-calculator.md?endpoint=%2Fapi-reference%2Fhyperliquid-info%2Fclearinghouse-state).

> [!NOTE]
>
> * Wire-equal to `POST api.hyperliquid.xyz/info` with `{"type": "clearinghouseState", "user": "..."}`.
> * The optional `dex` field returns state on a HIP-3 deployer’s perp DEX. Pass `"*"` or `"ALL_DEXES"` to return state across the native dex and every HIP-3 dex in one call.
> * Wildcard (`"*"` / `"ALL_DEXES"`) requests are billed at a flat `10 credits` vs. `1 credit` for a single-dex call.
> * The `perpDexs` list used for wildcard fan-out is cached \~2 minutes, so a newly-deployed dex may take up to that long to appear in wildcard results.

**Note:** Wildcard (`"*"` / `"ALL_DEXES"`) requests are **billed at a flat 10 credits per call.**

## Endpoint

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

## Request

**type** `string` *required* (default: clearinghouseState)

Always `"clearinghouseState"`.

**user** `string` *required*

The wallet address (lowercase 0x-prefixed hex).

**dex** `string`

HIP-3 builder DEX identifier. Empty string (default) returns canonical Hyperliquid perp state. Pass a builder code to query a HIP-3 deployer's perp DEX.

### Example

```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": "clearinghouseState",
    "user": "0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00",
    "dex": ""
  }'
```

```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: "clearinghouseState",
    user: "0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00",
    dex: "",
  }),
});

const state = 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": "clearinghouseState",
        "user": "0xecb63caa47c7c4e77f60f1ce858cf28dc2b82b00",
        "dex": "",
    },
)

state = response.json()
```

## Response

```json theme={null}
{
  "marginSummary": {
    "accountValue": "12450.83",
    "totalNtlPos": "8500.00",
    "totalRawUsd": "5200.50",
    "totalMarginUsed": "1700.00"
  },
  "crossMarginSummary": {
    "accountValue": "12450.83",
    "totalNtlPos": "8500.00",
    "totalRawUsd": "5200.50",
    "totalMarginUsed": "1700.00"
  },
  "crossMaintenanceMarginUsed": "850.00",
  "withdrawable": "10750.83",
  "assetPositions": [
    {
      "type": "oneWay",
      "position": {
        "coin": "ETH",
        "szi": "2.5",
        "leverage": { "type": "cross", "value": 5 },
        "entryPx": "3400.0",
        "positionValue": "8500.00",
        "unrealizedPnl": "120.50",
        "returnOnEquity": "0.07",
        "liquidationPx": "2800.5",
        "marginUsed": "1700.00",
        "maxLeverage": 50,
        "cumFunding": {
          "allTime": "12.30",
          "sinceOpen": "1.50",
          "sinceChange": "0.50"
        }
      }
    }
  ],
  "time": 1735689600000
}
```

### Field descriptions

> [!NOTE]
>
> All numeric fields below (account value, position size, prices, funding amounts, etc.) are returned as **decimal strings**, preserving upstream precision. Do not parse them as floats - keep them as strings or use a fixed-precision decimal type.

**marginSummary** `object`

Top-level account margin and value summary.

**properties**

**accountValue** `string`

Total account value in USD.

**totalNtlPos** `string`

Total notional position size.

**totalRawUsd** `string`

Raw USDC balance excluding unrealized PnL.

**totalMarginUsed** `string`

Margin currently committed to open positions.

**crossMarginSummary** `object`

Cross-margin subset of the margin summary. Same fields.

**crossMaintenanceMarginUsed** `string`

Maintenance margin currently used for cross positions.

**withdrawable** `string`

Amount currently withdrawable, in USD.

**assetPositions** `array\<object\>`

Open positions, one entry per coin.

**properties**

**type** `string`

Position type - `"oneWay"` for the standard mode.

**position** `object`

**properties**

**coin** `string`

Asset symbol.

**szi** `string`

Signed position size (positive = long, negative = short).

**leverage** `object`

Two shapes:

* Cross: `{ "type": "cross", "value": int }`
* Isolated: `{ "type": "isolated", "value": int, "rawUsd": string }`

`rawUsd` is **only present** for isolated leverage and may be negative.

**entryPx** `string`

Volume-weighted entry price.

**positionValue** `string`

Current notional value.

**unrealizedPnl** `string`

Unrealized PnL in USD.

**returnOnEquity** `string`

Unrealized return on margin used.

**liquidationPx** `string | null`

Liquidation price. **May be literal JSON `null`** when no near-term liquidation applies (e.g. cross-margin with deep cushion).

**marginUsed** `string`

Margin committed to this position.

**maxLeverage** `int`

Maximum leverage for this asset.

**cumFunding** `object`

Cumulative funding paid: `allTime`, `sinceOpen`, `sinceChange`.

**time** `int`

Snapshot timestamp in milliseconds since Unix epoch.

## Related endpoints

> [card] [spotClearinghouseState](https://goldrush.dev/docs/api-reference/hyperliquid-info/spot-clearinghouse-state.md)
>
> fetch a single user's spot account balances by wallet address.

> [card] [batchClearinghouseState](https://goldrush.dev/docs/api-reference/hyperliquid-info/batch-clearinghouse-state.md)
>
> fetch perpetuals account state for up to 50 wallets in a single request.

> [card] [batchSpotClearinghouseState](https://goldrush.dev/docs/api-reference/hyperliquid-info/batch-spot-clearinghouse-state.md)
>
> fetch spot account balances for up to 50 wallets in a single request.

> [card] [borrowLendUserState](https://goldrush.dev/docs/api-reference/hyperliquid-info/borrow-lend-user-state.md)
>
> monitor a wallet’s current borrow/lend positions and liquidation risk (account health) in a single call.

> [card] [portfolioState](https://goldrush.dev/docs/api-reference/hyperliquid-info/portfolio-state.md)
>
> fetch a wallet's perp clearinghouse state, spot balances, and account-abstraction mode in a single request.

> [card] [liquidatable](https://goldrush.dev/docs/api-reference/hyperliquid-info/liquidatable.md)
>
> list accounts currently eligible for liquidation.

See all Hyperliquid endpoints: [Overview hub](https://goldrush.dev/docs/goldrush-hyperliquid/overview.md) · [Info API reference](https://goldrush.dev/docs/goldrush-hyperliquid/info-api/overview.md)

*Last reviewed: 2026-07-23*


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.