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

# borrowLendUserState | Hyperliquid Info API

> Hyperliquid borrowLendUserState: monitor a wallet’s current borrow/lend positions and liquidation risk (account health) in a single call.

> [card] Credit Cost
>
> 1 per call

> [card] Processing
>
> Realtime

The Hyperliquid info endpoint with `type: "borrowLendUserState"` is used to monitor a wallet’s current borrow/lend positions and liquidation risk (account health) in a single call.

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

> [!NOTE]
>
> * Wire-equal to `POST api.hyperliquid.xyz/info` with `{"type": "borrowLendUserState", "user": "..."}`.
> * `tokenToState` is an array of `[tokenIndex, state]` pairs — empty for users with no borrow/lend positions (the common case). `tokenIndex` is the Hyperliquid token index (e.g. `150` = HYPE on mainnet).
> * Each `state` has `borrow` and `supply` objects shaped `{ "value": <string>, "basis": <string> }` — `value` is the amount owed or held now, `basis` is the cost basis.
> * `health` is one of `"healthy"`, `"atRisk"`, or `"liquidatable"`; `healthFactor` is a decimal string, or `null`until the user borrows.
> * Balances and `healthFactor` are decimal strings — keep them as strings or use a fixed-precision decimal type rather than parsing as floats.

Returns a user’s current spot borrow/lend state: the borrowed and supplied (lent) balance of each token the user holds a position in, plus an account-level health summary. The payload is a JSON object with tokenToState, health, and healthFactor; tokenToState is an array of \[tokenIndex, state] pairs and is empty for users with no borrow/lend positions.

## Endpoint

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

## Request

**type** `string` *required*

Always `"borrowLendUserState"`.

**user** `string` *required*

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

### 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": "borrowLendUserState",
    "user": "0x2057d4f2b6ea957b63371980775b0a5505a438f0"
  }'
```

```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: "borrowLendUserState",
    user: "0x2057d4f2b6ea957b63371980775b0a5505a438f0",
  }),
});

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": "borrowLendUserState",
        "user": "0x2057d4f2b6ea957b63371980775b0a5505a438f0",
    },
)

state = response.json()
```

## Response

A single object. This wallet borrows USDC (token `0`) against HYPE (token `150`) it has supplied:

```json theme={null}
{
  "tokenToState": [
    [
      0,
      {
        "borrow": { "basis": "550000.13902679", "value": "553106.31635104" },
        "supply": { "basis": "0.0", "value": "0.0" }
      }
    ],
    [
      150,
      {
        "borrow": { "basis": "0.0", "value": "0.0" },
        "supply": { "basis": "25000.0", "value": "25000.0" }
      }
    ]
  ],
  "health": "healthy",
  "healthFactor": "2.277500659"
}
```

A wallet with no borrow/lend positions returns an empty `tokenToState` and a `null` `healthFactor`:

```json theme={null}
{ "tokenToState": [], "health": "healthy", "healthFactor": null }
```

### Field descriptions

> [!NOTE]
>
> `value`, `basis` and `healthFactor` are returned as **decimal strings**, preserving upstream precision. Do not parse them as floats.

**tokenToState** `array`

One `[tokenIndex, state]` pair per token the user has a borrow/lend position in. Empty when the user has none.

**state**

**borrow** `object`

The user's borrowed balance of this token.

**properties**

**value** `string`

Amount owed now, including accrued interest.

**basis** `string`

Cost basis of the borrowed amount.

**supply** `object`

The user's supplied (lent) balance of this token.

**properties**

**value** `string`

Amount held now, including accrued interest.

**basis** `string`

Cost basis of the supplied amount.

**health** `string`

Account health: `"healthy"`, `"atRisk"` or `"liquidatable"`.

**healthFactor** `string | null`

Account health factor as a decimal string, or `null` until the user borrows.

## Related endpoints

> [card] [userBorrowLendInterest](https://goldrush.dev/docs/api-reference/hyperliquid-info/user-borrow-lend-interest.md)
>
> fetch a user’s borrow/lend interest accrual history.

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

> [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] [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-11-05*


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