get_liquidity_positions
Retrieve liquidity positions for a specific account on the Casper Network DEX to monitor pool participation and holdings.
Instructions
Get liquidity positions for an account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_public_key | Yes | Account public key (hex) | |
| currency | No | Fiat currency code |
Implementation Reference
- packages/sdk/src/client.ts:154-158 (handler)The implementation of the getLiquidityPositions method in the CsprTradeClient class, which fetches and maps liquidity positions.
async getLiquidityPositions(publicKey: string, currency?: string): Promise<LiquidityPosition[]> { const currencyId = currency ? await this.currencyResolver.resolveToId(currency) : undefined; const raw = await this.liquidityApi.getPositions(publicKey, currencyId); return raw.map(mapLiquidityPosition); } - packages/mcp/src/tools/account.ts:6-17 (registration)Registration of the 'get_liquidity_positions' tool within the MCP server using the CsprTradeClient.
server.tool( 'get_liquidity_positions', 'Get liquidity positions for an account', { account_public_key: z.string().describe('Account public key (hex)'), currency: z.string().optional().describe('Fiat currency code'), }, async ({ account_public_key, currency }) => { const positions = await client.getLiquidityPositions(account_public_key, currency); return { content: [{ type: 'text' as const, text: JSON.stringify(positions, null, 2) }] }; }, );