# Ironflow Hyperliquid Wallet Position & Margin State

> Ironflow Hyperliquid Wallet Position & Margin State is a paid API for AI agents from api.ironflow.sh, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Returns all open perpetual, spot, and prediction market positions for a Hyperliquid wallet address, including size, entry/mark price, unrealized PnL, leverage, and margin totals.

## Facts

- Endpoint: GET https://api.ironflow.sh/x402/v1/analytics/user-state?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ironflow-hyperliquid-wallet-position-margin-state-992d8b85
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_esP_tlXoH3wSRA-7ZPtMg

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability ironflow-hyperliquid-wallet-position-margin-state-992d8b85
```

Example prompt: What positions is the Hyperliquid wallet 0x1234567890abcdef1234567890abcdef12345678 holding right now — are they long or short, what's the leverage, and how much unrealized PnL do they have?

## When to prefer this

Use this endpoint when you need real-time, per-position detail on a specific Hyperliquid wallet — including unrealized PnL, entry vs. mark price, and leverage breakdown by market. Prefer it over leaderboard or aggregate endpoints when you need position-level granularity for a known address (whale, vault, or trader you follow), not rankings or cross-wallet comparisons.

## Known failure modes

- INVALID_PARAMETER: wallet address is not a valid 42-character 0x hex string
- NOT_FOUND: wallet address has no positions or does not exist on Hyperliquid
- RATE_LIMIT_EXCEEDED: too many calls in a short window; response includes upgrade hint
- INTERNAL_ERROR: upstream Hyperliquid node issue; retry with backoff
- Empty asset_positions array returned when wallet exists but has no open positions

## How this service works

Open positions and margin of any Hyperliquid wallet right now: per market size, entry and mark price, position value, unrealized PnL, return on equity and leverage, plus totals. Use it to check whether a wallet (a whale, a vault, a trader you follow) is long or short and how much it is up or down.

## Output

A JSON object containing the queried wallet address, a margin_summary with total open markets count, total position value in USD, and total unrealized PnL in USD; plus an asset_positions array where each entry includes market symbol, market class (perp/spot/prediction/option), signed position size, entry price, mark price, position value, unrealized PnL, leverage, and leverage type (cross/isolated).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "address": {
       "type": "string",
       "description": "0x wallet address (42 characters)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "error": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string",
         "description": "Machine-readable code: INVALID_PARAMETER, HISTORY_OUT_OF_RANGE, QUERY_WINDOW_EXCEEDED, RATE_LIMIT_EXCEEDED, NOT_FOUND, INTERNAL_ERROR"
        },
        "message": {
         "type": "string",
         "description": "What went wrong and how to fix the request"
        },
        "upgrade": {
         "type": "object",
         "properties": {},
         "description": "On a limit error: the plan or paid call that lifts it"
        }
       },
       "description": "Present instead of the data on a 4xx or 5xx answer."
      },
      "address": {
       "type": "string",
       "description": "Wallet address"
      },
      "margin_summary": {
       "type": "object",
       "properties": {
        "open_markets_count": {
         "type": "integer",
         "description": "Open positions"
        },
        "total_position_value": {
         "type": "number",
         "description": "USD"
        },
        "total_unrealized_pnl": {
         "type": "number",
         "description": "USD"
        }
       },
       "description": "Totals"
      },
      "asset_positions": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "size": {
          "type": "number",
          "description": "Signed size in the base asset: negative is short"
         },
         "market": {
          "type": "string",
          "description": "Market symbol, e.g. BTC-PERP, HYPE/USDC, xyz:NVDA-PERP"
         },
         "leverage": {
          "type": "number",
          "d
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ironflow-hyperliquid-wallet-position-margin-state-992d8b85/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.ironflow.sh](https://www.zero.xyz/host/api.ironflow.sh/llms.txt)
