{"uid":"cap_esP_tlXoH3wSRA-7ZPtMg","slug":"ironflow-hyperliquid-wallet-position-margin-state-992d8b85","name":"Ironflow Hyperliquid Wallet Position & Margin State","description":"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.","url":"https://api.ironflow.sh/x402/v1/analytics/user-state?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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","description":"Leverage"},"mark_price":{"type":"number","description":"Mark price"},"entry_price":{"type":"number","description":"Average entry price"},"market_class":{"type":"string","description":"perp, spot, prediction or option"},"leverage_type":{"enum":["cross","isolated"],"type":"string","description":"Margin mode"},"position_value":{"type":"number","description":"Position value, USD"},"unrealized_pnl":{"type":"number","description":"Unrealized PnL, USD"},"return_on_equity":{"type":"number","description":"Unrealized PnL over margin used"}},"description":"A position"},"description":"Open positions"}},"description":"A wallet's open positions"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_41xr2hVM8ynevp71YkdhY","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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?","exampleUseCases":[{"title":"Whale position surveillance","prompt":"Check what positions this Hyperliquid whale wallet 0xabc123...def456 is holding right now — I want to know if they're long or short BTC, their entry price, and how much they're up or down."},{"title":"Vault profitability check","prompt":"Look up the open positions and unrealized PnL for this Hyperliquid vault address 0xdeadbeef...cafe1234 — I want to see the total position value and whether it's currently profitable."},{"title":"Copy-trader leverage monitoring","prompt":"Pull the current margin state for Hyperliquid address 0x9876543210fedcba9876543210fedcba98765432 — I need to see which markets they're in, what leverage they're running, and their return on equity."}],"resultDescription":"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).","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T06:36:46.685Z","isFirstParty":false,"canonicalSlug":"ironflow-hyperliquid-wallet-position-margin-state-992d8b85"}