tapp_remove_multiple_amm_liquidity
Remove liquidity from multiple AMM positions on Tapp Exchange by specifying pool ID, position addresses, share tokens to burn, and minimum token amounts.
Instructions
Remove liquidity from multiple AMM positions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| poolId | Yes | The ID of the pool | |
| positions | Yes | An array of position objects |
Implementation Reference
- src/mcp/tapp/liquidity-tools.ts:177-199 (handler)Defines the core MCP tool 'tapp_remove_multiple_amm_liquidity' including name, description, input schema (Zod validation), and handler function that delegates to TappAgent.removeMultipleAMMLiquidity and returns the transaction response.export const RemoveMultipleAMMLiquidityTool: McpTool = { name: "tapp_remove_multiple_amm_liquidity", description: "Remove liquidity from multiple AMM positions", schema: { poolId: z.string().describe("The ID of the pool"), positions: z.array(z.object({ positionAddr: z.string().describe("The address of the liquidity position"), mintedShare: z.number().describe("The amount of share tokens to burn"), minAmount0: z.number().describe("Minimum amount token0"), minAmount1: z.number().describe("Minimum amount token1") })).describe("An array of position objects") }, handler: async (agent: TappAgent, input: Record<string, any>) => { const result = await agent.removeMultipleAMMLiquidity({ poolId: input.poolId, positions: input.positions }); return { status: "success", transaction: result }; }, };
- src/mcp/index.ts:25-58 (registration)Registers RemoveMultipleAMMLiquidityTool (tool name 'tapp_remove_multiple_amm_liquidity') in the main TappExchangeMcpTools export object, which is used by the MCP server.export const TappExchangeMcpTools = { // Pool Management Tools "GetPoolsTool": GetPoolsTool, "GetPoolInfoTool": GetPoolInfoTool, // Swap Tools "GetSwapEstimateTool": GetSwapEstimateTool, "GetSwapRouteTool": GetSwapRouteTool, "SwapAMMTool": SwapAMMTool, "SwapCLMMTool": SwapCLMMTool, "SwapStableTool": SwapStableTool, // Pool Creation and Initial Liquidity Tools "CreateAMMPoolAndAddLiquidityTool": CreateAMMPoolAndAddLiquidityTool, "CreateCLMMPoolAndAddLiquidityTool": CreateCLMMPoolAndAddLiquidityTool, "CreateStablePoolAndAddLiquidityTool": CreateStablePoolAndAddLiquidityTool, // Add Liquidity Tools "AddAMMLiquidityTool": AddAMMLiquidityTool, "AddCLMMLiquidityTool": AddCLMMLiquidityTool, "AddStableLiquidityTool": AddStableLiquidityTool, // Remove Liquidity Tools "RemoveSingleAMMLiquidityTool": RemoveSingleAMMLiquidityTool, "RemoveMultipleAMMLiquidityTool": RemoveMultipleAMMLiquidityTool, "RemoveSingleCLMMLiquidityTool": RemoveSingleCLMMLiquidityTool, "RemoveMultipleCLMMLiquidityTool": RemoveMultipleCLMMLiquidityTool, "RemoveSingleStableLiquidityTool": RemoveSingleStableLiquidityTool, "RemoveMultipleStableLiquidityTool": RemoveMultipleStableLiquidityTool, // Position Management Tools "GetPositionsTool": GetPositionsTool, "CollectFeeTool": CollectFeeTool };
- src/agent/index.ts:464-483 (helper)Implements TappAgent.removeMultipleAMMLiquidity: calls tapp-sdk to generate transaction payload and submits it using Aptos SDK, handling success/error response.async removeMultipleAMMLiquidity(params: RemoveMultipleAMMLiquidityParams): Promise<TransactionResponse> { try { const data = this.sdk.Position.removeMultipleAMMLiquidity(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' }; } }