Skip to main content
Glama

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
NameRequiredDescriptionDefault
account_public_keyYesAccount public key (hex)
currencyNoFiat currency code

Implementation Reference

  • 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);
    }
  • 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) }] };
      },
    );

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/make-software/cspr-trade-mcp'

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