Skip to main content
Glama

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
NameRequiredDescriptionDefault
wallet_idNoWallet ID. Auto-resolved for single-wallet sessions.
sub_accountNoSub-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);
    },
  • 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);
      },
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/minhoyoo-iotrust/WAIaaS'

If you have feedback or need assistance with the MCP directory API, please join our Discord server