waiaas_hl_get_positions
Retrieve Hyperliquid perpetual trading positions for a specific wallet, enabling portfolio tracking and risk management in decentralized finance.
Instructions
Get Hyperliquid perpetual positions for a wallet.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet_id | No | Wallet ID. Auto-resolved for single-wallet sessions. | |
| sub_account | No | Sub-account address (hex). |
Implementation Reference
- Handler function for 'waiaas_hl_get_positions' tool.
async (args) => { const params = new URLSearchParams(); if (args.wallet_id) params.set('wallet_id', args.wallet_id); if (args.sub_account) params.set('subAccount', args.sub_account); const walletId = args.wallet_id || 'default'; const qs = params.toString(); const result = await apiClient.get(`/v1/wallets/${walletId}/hyperliquid/positions${qs ? '?' + qs : ''}`); return toToolResult(result); }, - packages/mcp/src/tools/hyperliquid.ts:21-37 (registration)Registration of the 'waiaas_hl_get_positions' tool within the McpServer.
server.tool( 'waiaas_hl_get_positions', withWalletPrefix('Get Hyperliquid perpetual positions for a wallet.', walletContext?.walletName), { wallet_id: z.string().optional().describe('Wallet ID. Auto-resolved for single-wallet sessions.'), sub_account: z.string().optional().describe('Sub-account address (hex).'), }, async (args) => { const params = new URLSearchParams(); if (args.wallet_id) params.set('wallet_id', args.wallet_id); if (args.sub_account) params.set('subAccount', args.sub_account); const walletId = args.wallet_id || 'default'; const qs = params.toString(); const result = await apiClient.get(`/v1/wallets/${walletId}/hyperliquid/positions${qs ? '?' + qs : ''}`); return toToolResult(result); }, );