{
  "markdown": "# HL Portfolio API\n\n[![MCP Server](https://img.shields.io/badge/MCP-server-blue)](https://hl-portfolio.api.klymax402.com/mcp)\n[![x402](https://img.shields.io/badge/payments-x402-6E56CF)](https://x402.org)\n[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n\nAnalyze Hyperliquid accounts: positions, PnL, fills, open orders, funding. Full clearinghouse state for any wallet. The portfolio layer agents need for Hyperliquid trading intelligence. Pay-per-call via [x402](https://x402.org) (USDC on Base L2) -- no API key, no signup, no rate-limit wall.\n\nPart of the [klymax402](https://klymax402.com) marketplace -- 100 x402 micropayment APIs for AI agents, one wallet, USDC on Base.\n\n## Quickstart -- MCP\n\nAdd to your MCP client config (Claude Desktop, Cursor, ElizaOS, etc.):\n\n```json\n{\n  \"mcpServers\": {\n    \"hl-portfolio\": {\n      \"url\": \"https://hl-portfolio.api.klymax402.com/mcp\"\n    }\n  }\n}\n```\n\n## Quickstart -- HTTP (x402)\n\n```bash\ncurl -X POST \"https://hl-portfolio.api.klymax402.com/api/account\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"address\":\"0x0000000000000000000000000000000000dEaD\"}'\n# -> 402 Payment Required, with an x402 payment challenge in the response body\n```\n\nAny x402-aware client ([`@x402/fetch`](https://www.npmjs.com/package/@x402/fetch), [`x402-agent-tools`](https://www.npmjs.com/package/x402-agent-tools), ATXP) handles the 402 -> sign -> retry cycle automatically.\n\n## Tools\n\n| Tool | Method | Path | Price | Description |\n|---|---|---|---|---|\n| `hyperliquid_get_account_state` | POST | `/api/account` | $0.008 | Full clearinghouse state for a Hyperliquid wallet: positions, margin, PnL, leverage, liquidation prices. |\n| `hyperliquid_get_trade_fills` | POST | `/api/fills` | $0.008 | Recent trade fills for a Hyperliquid wallet: coin, side, size, price, fee, closedPnl, timestamp. |\n| `hyperliquid_get_open_orders` | POST | `/api/orders` | $0.005 | Open orders for a Hyperliquid wallet: coin, side, size, price, order type, reduce-only flag. |\n| `hyperliquid_get_user_funding` | POST | `/api/funding` | $0.005 | Funding payments received/paid by a Hyperliquid wallet: coin, amount, rate, timestamp. |\n\n### `hyperliquid_get_account_state`\n\nUse this when you need to retrieve the full portfolio state of a Hyperliquid perpetuals account. Returns the complete clearinghouse state for any wallet address including account-level metrics and per-position details.\n\n**Parameters**\n\n| Name | Type | Required | Description |\n|---|---|---|---|\n| `address` | string | yes | Hyperliquid wallet address (0x...) to retrieve account state for |\n\nExample response:\n\n```json\n{ accountValue: \"125430.50\", totalNtlPos: \"89200.00\", withdrawable: \"36230.50\", positions: [{ coin: \"BTC\", size: \"1.5\", entryPrice: \"67500.00\", unrealizedPnl: \"2340.00\", leverage: 5, liquidationPrice: \"54200.00\", marginType: \"cross\" }] }\n```\n\n**When to use**: analyzing a trader's risk exposure, checking margin health, or evaluating portfolio allocation on Hyperliquid. Essential for copy-trading evaluation and risk monitoring.\n\n**Not for**: trade history (use `hyperliquid_get_trade_fills`), open orders (use `hyperliquid_get_open_orders`), funding payments (use `hyperliquid_get_user_funding`), vault performance (use `hyperliquid_get_vault_details`), whale tracking (use `hyperliquid_detect_whale_trades`).\n\n### `hyperliquid_get_trade_fills`\n\nUse this when you need to retrieve recent trade executions (fills) for a Hyperliquid perpetuals account. Returns the most recent trades with full execution details including realized PnL on closed positions.\n\n**Parameters**\n\n| Name | Type | Required | Description |\n|---|---|---|---|\n| `address` | string | yes | Hyperliquid wallet address (0x...) to retrieve trade fills for |\n| `limit` | number | no | Maximum number of fills to return (default: 20, max: 100) |\n\nExample response:\n\n```json\n{ fills: [{ coin: \"ETH\", side: \"buy\", size: \"10.0\", price: \"3450.50\", fee: \"0.69\", closedPnl: \"0.00\", timestamp: 1712000000000 }], count: 20 }\n```\n\n**Not for**: current positions (use `hyperliquid_get_account_state`), open/pending orders (use `hyperliquid_get_open_orders`), funding payments (use `hyperliquid_get_user_funding`).\n\n### `hyperliquid_get_open_orders`\n\nUse this when you need to see all pending/open orders for a Hyperliquid perpetuals account. Returns every resting order on the book with full order parameters.\n\n**Parameters**\n\n| Name | Type | Required | Description |\n|---|---|---|---|\n| `address` | string | yes | Hyperliquid wallet address (0x...) to retrieve open orders for |\n\nExample response:\n\n```json\n{ orders: [{ coin: \"BTC\", side: \"buy\", limitPx: \"65000.00\", sz: \"0.5\", orderType: \"limit\", reduceOnly: false, oid: 123456 }], count: 3 }\n```\n\n**Not for**: executed trades (use `hyperliquid_get_trade_fills`), current positions (use `hyperliquid_get_account_state`).\n\n### `hyperliquid_get_user_funding`\n\nUse this when you need to retrieve funding payment history for a Hyperliquid perpetuals account. Returns all funding rate payments received or paid, useful for calculating funding income/expense and evaluating carry trade profitability.\n\n**Parameters**\n\n| Name | Type | Required | Description |\n|---|---|---|---|\n| `address` | string | yes | Hyperliquid wallet address (0x...) to retrieve funding history for |\n| `startTime` | number | no | Unix timestamp in milliseconds to start from (optional, default: last 7 days) |\n\nExample response:\n\n```json\n{ funding: [{ coin: \"BTC\", fundingRate: \"0.0001\", payment: \"-1.35\", timestamp: 1712000000000, positionSize: \"1.5\" }], totalReceived: \"45.20\", totalPaid: \"-12.30\", netFunding: \"32.90\" }\n```\n\n**Not for**: current positions (use `hyperliquid_get_account_state`), funding arbitrage opportunities (use `funding_arb_find_opportunities`), trade execution history (use `hyperliquid_get_trade_fills`).\n\n## Example agent prompts\n\n- \"Retrieve the full portfolio state of a Hyperliquid perpetuals account\"\n- \"Retrieve recent trade executions (fills) for a Hyperliquid perpetuals account\"\n- \"See all pending/open orders for a Hyperliquid perpetuals account\"\n\n## Payment\n\n- Protocol: [x402](https://x402.org) -- HTTP-native pay-per-call, no signup, no API key\n- Network: Base L2 (`eip155:8453`)\n- Asset: USDC\n- Facilitator: Coinbase CDP (primary), PayAI (fallback)\n- Also reachable via [ATXP](https://atxp.ai) (OAuth-wrapped x402, RFC 9728 protected-resource metadata)\n\n## Part of klymax402\n\n100 x402 micropayment APIs for AI agents -- one wallet, USDC on Base, zero signup.\n\n- Catalog: https://klymax402.com/llms.txt\n- Full API reference: https://klymax402.com/llms-full.txt\n- Live stats: https://klymax402.com/stats\n\n## License\n\nMIT\n",
  "bytes": 6660,
  "sha": "d384b54eccec8a3bd8182a3543a742e2ec7ccd5c765229ca6f393f6a9d4de8ef",
  "repo_slug": "br0ski777/hl-portfolio-x402",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_br0ski777_hl_portfolio_eb5c9276/readme"
}