Skip to main content
Glama

tapp_create_clmm_pool_and_add_liquidity

Create a CLMM pool on Tapp Exchange, define trading fees, and add initial liquidity with specified token amounts, price range, and initial price.

Instructions

Create a CLMM pool and add initial liquidity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountsYesThe initial token amounts
feeYesThe fee traders will pay to use your pool's liquidity
initialPriceYesStarting price for liquidity
isMaxAmountBYesWhether the second token amount (amountB) is flexible based on slippage
maxPriceYesThe upper bound price of the liquidity range
minPriceYesThe lower bound price of the liquidity range
tokenAddressYesAn array of token addresses

Implementation Reference

  • Primary definition and registration of the McpTool named 'tapp_create_clmm_pool_and_add_liquidity' including schema and inline handler
    export const CreateCLMMPoolAndAddLiquidityTool: McpTool = { name: "tapp_create_clmm_pool_and_add_liquidity", description: "Create a CLMM pool and add initial liquidity", schema: { tokenAddress: z.array(z.string()).describe("An array of token addresses"), fee: z.number().describe("The fee traders will pay to use your pool's liquidity"), amounts: z.array(z.number()).describe("The initial token amounts"), initialPrice: z.number().describe("Starting price for liquidity"), minPrice: z.number().describe("The lower bound price of the liquidity range"), maxPrice: z.number().describe("The upper bound price of the liquidity range"), isMaxAmountB: z.boolean().describe("Whether the second token amount (amountB) is flexible based on slippage") }, handler: async (agent: TappAgent, input: Record<string, any>) => { const result = await agent.createCLMMPoolAndAddLiquidity({ tokenAddress: input.tokenAddress, fee: input.fee, amounts: input.amounts, initialPrice: input.initialPrice, minPrice: input.minPrice, maxPrice: input.maxPrice, isMaxAmountB: input.isMaxAmountB }); return { status: "success", transaction: result }; }, };
  • Core handler logic in TappAgent that creates the CLMM pool and adds liquidity by calling the Tapp SDK and submitting the transaction
    async createCLMMPoolAndAddLiquidity(params: CreateCLMMPoolAndAddLiquidityParams): Promise<TransactionResponse> { try { const data = this.sdk.Position.createCLMMPoolAndAddLiquidity(params); const response = await this.aptos.transaction.submit.simple({ sender: this.account.accountAddress, data: data } as any); return { hash: response.hash, success: true }; } catch (error) { return { hash: '', success: false, error: error instanceof Error ? error.message : 'Unknown error' }; } }
  • Zod input schema for the tool parameters
    schema: { tokenAddress: z.array(z.string()).describe("An array of token addresses"), fee: z.number().describe("The fee traders will pay to use your pool's liquidity"), amounts: z.array(z.number()).describe("The initial token amounts"), initialPrice: z.number().describe("Starting price for liquidity"), minPrice: z.number().describe("The lower bound price of the liquidity range"), maxPrice: z.number().describe("The upper bound price of the liquidity range"), isMaxAmountB: z.boolean().describe("Whether the second token amount (amountB) is flexible based on slippage") },
  • src/mcp/index.ts:39-39 (registration)
    Final registration of the tool in the main TappExchangeMcpTools export object
    "CreateCLMMPoolAndAddLiquidityTool": CreateCLMMPoolAndAddLiquidityTool,
  • MCP tool handler that extracts input and calls the TappAgent method
    handler: async (agent: TappAgent, input: Record<string, any>) => { const result = await agent.createCLMMPoolAndAddLiquidity({ tokenAddress: input.tokenAddress, fee: input.fee, amounts: input.amounts, initialPrice: input.initialPrice, minPrice: input.minPrice, maxPrice: input.maxPrice, isMaxAmountB: input.isMaxAmountB }); return { status: "success", transaction: 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/tamago-labs/tapp-exchange-mcp'

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