# Hyperliquid — Query borrow/lend user state

Get Hyperliquid User Lending State data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Hyperliquid, pass parameters such as type, user, and retrieve structured data including reported lending health label and token-indexed state collection for account diagnostics, and token-state handling, ready for production pipelines and AI agent automation.

Documentation: https://openany.si/hyperliquid/hyperliquid-query-borrow-lend-user-state/6c9e8c42-f5e7-49dc-80a0-6f13d637f381/
API ID: 6c9e8c42-f5e7-49dc-80a0-6f13d637f381
Provider: hyperliquid
Contract revision: 4
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/hyperliquid/info/borrow-lend-user-state
Page update time: 2026-12-03T02:49:34.467Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: application/json
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0 / call
The published contract currently has no usage charge. Authentication and service limits still apply.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:49:33.915Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "0",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## Hyperliquid User Lending State API

POST type="borrowLendUserState" and user. The object separates health, healthFactor and tokenToState. healthFactor can be null and tokenToState can be empty; keep these values distinct rather than manufacturing a numeric health factor or token position.

## What You Can Build

- **Account diagnostics**: Show the reported health label and factor availability.
- **Token-state handling**: Keep an empty collection distinct from reported positions.

## Documented Response Fields

| Field | Meaning |
| --- | --- |
| `health` | Reported lending health label |
| `healthFactor` | Reported health factor; can be null |
| `tokenToState` | Token-indexed state collection |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Hyperliquid — Query borrow/lend user state request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {}
    },
    "headers": {
      "type": "object",
      "properties": {}
    },
    "body": {
      "additionalProperties": false,
      "examples": [
        {
          "type": "borrowLendUserState",
          "user": "0x677d831aef5328190852e24f13c46cac05f984e7"
        }
      ],
      "properties": {
        "type": {
          "const": "borrowLendUserState",
          "description": "Fixed native Info query discriminator.",
          "enum": [
            "borrowLendUserState"
          ],
          "example": "borrowLendUserState",
          "type": "string"
        },
        "user": {
          "description": "hexadecimal format; e.g. 0x0000000000000000000000000000000000000000.",
          "example": "0x677d831aef5328190852e24f13c46cac05f984e7",
          "pattern": "^0x[0-9a-fA-F]{40}$",
          "type": "string"
        }
      },
      "required": [
        "type",
        "user"
      ],
      "type": "object",
      "description": "Query borrow/lend user state Documentation prepared only; runtime not verified."
    }
  },
  "required": [
    "path",
    "query",
    "headers",
    "body"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "health": {
      "type": "string"
    },
    "healthFactor": {
      "type": "null"
    },
    "tokenToState": {
      "type": "array",
      "items": {}
    }
  }
}
```

## Request example
Scenario: Documentation example
```bash
curl \
  'https://api.openany.si/v1/agent-apis/hyperliquid/info/borrow-lend-user-state' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "type": "borrowLendUserState",
  "user": "0x677d831aef5328190852e24f13c46cac05f984e7"
}'
```

## Response example
Published documentation example. Verify the actual response after an approved call.
Sample response · Documented HTTP 200
```json
{
  "health": "healthy",
  "healthFactor": null,
  "tokenToState": []
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Is healthFactor=null a zero health factor?
No. Preserve null as unavailable factor information and read the health label separately.

### Does an empty tokenToState contain a zero-value position?
No. It contains no token state entries for that response. Display an empty collection.

### Can I choose a token in this request?
This implementation accepts the fixed type and user only. It has no token selector.

### Can I infer reserve totals from this response?
Use a separate reserve-state query for reserve-wide totals. This route describes the selected user’s lending state.

### Which API key should I use?
Use your OpenAny API key as Bearer authentication on the documented OpenAny route.

### Where can I check the current request price?
Check the pricing area for the selected implementation. Follow its billing unit and any request-dependent rules before sending the request.

## Available implementations
- hyperliquid: https://openany.si/hyperliquid/hyperliquid-query-borrow-lend-user-state/6c9e8c42-f5e7-49dc-80a0-6f13d637f381/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
