waiaas_get_defi_positions
Retrieve DeFi lending positions with health factors and USD values to monitor wallet exposure and risk levels.
Instructions
Get DeFi lending positions with health factor and USD amounts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet_id | No | Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet. |
Implementation Reference
- The handler logic for the 'waiaas_get_defi_positions' tool, which fetches data from the API endpoint '/v1/wallet/positions'.
async (args) => { const params = new URLSearchParams(); if (args.wallet_id) params.set('wallet_id', args.wallet_id); const qs = params.toString(); const result = await apiClient.get('/v1/wallet/positions' + (qs ? '?' + qs : '')); return toToolResult(result); }, - packages/mcp/src/tools/get-defi-positions.ts:10-25 (registration)The registration function for the 'waiaas_get_defi_positions' tool within the MCP server.
export function registerGetDefiPositions(server: McpServer, apiClient: ApiClient, walletContext?: WalletContext): void { server.tool( 'waiaas_get_defi_positions', withWalletPrefix('Get DeFi lending positions with health factor and USD amounts.', walletContext?.walletName), { wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'), }, async (args) => { const params = new URLSearchParams(); if (args.wallet_id) params.set('wallet_id', args.wallet_id); const qs = params.toString(); const result = await apiClient.get('/v1/wallet/positions' + (qs ? '?' + qs : '')); return toToolResult(result); }, ); }