tapp_add_clmm_liquidity
Add liquidity to a Concentrated Liquidity Market Maker (CLMM) pool on Tapp Exchange by specifying pool ID, token amounts, fee tier, price range, and slippage flexibility.
Instructions
Add liquidity to an existing CLMM pool
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amountA | Yes | The amount of token A to add | |
| amountB | Yes | The amount of token B to add | |
| fee | Yes | The fee tier of the pool | |
| isMaxAmountB | Yes | Whether the second token amount (amountB) is flexible based on slippage | |
| maxPrice | Yes | The maximum price of the liquidity range | |
| minPrice | Yes | The minimum price of the liquidity range | |
| poolId | Yes | The unique identifier of the CLMM pool |
Implementation Reference
- src/mcp/tapp/liquidity-tools.ts:115-129 (handler)MCP tool handler that validates input, calls TappAgent.addCLMMLiquidity, and returns transaction result.handler: async (agent: TappAgent, input: Record<string, any>) => { const result = await agent.addCLMMLiquidity({ poolId: input.poolId, amountA: input.amountA, amountB: input.amountB, fee: input.fee, isMaxAmountB: input.isMaxAmountB, minPrice: input.minPrice, maxPrice: input.maxPrice }); return { status: "success", transaction: result }; },
- Zod schema defining the input parameters for the tapp_add_clmm_liquidity tool.schema: { poolId: z.string().describe("The unique identifier of the CLMM pool"), amountA: z.number().describe("The amount of token A to add"), amountB: z.number().describe("The amount of token B to add"), fee: z.number().describe("The fee tier of the pool"), isMaxAmountB: z.boolean().describe("Whether the second token amount (amountB) is flexible based on slippage"), minPrice: z.number().describe("The minimum price of the liquidity range"), maxPrice: z.number().describe("The maximum price of the liquidity range")
- src/mcp/index.ts:44-44 (registration)Registration of the AddCLMMLiquidityTool (named tapp_add_clmm_liquidity) in the central TappExchangeMcpTools object."AddCLMMLiquidityTool": AddCLMMLiquidityTool,
- src/agent/index.ts:400-419 (helper)TappAgent helper method that generates and submits the add CLMM liquidity transaction using the Tapp SDK.async addCLMMLiquidity(params: AddCLMMLiquidityParams): Promise<TransactionResponse> { try { const data = this.sdk.Position.addCLMMLiquidity(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' }; } }
- src/types/index.ts:54-54 (schema)TypeScript interface reference for AddCLMMLiquidityParams used in TappAgent.AddCLMMLiquidityParams,