tapp_remove_single_stable_liquidity
Removes liquidity from a single STABLE pool position on Tapp Exchange. Specify the pool ID, position address, share tokens to burn, and minimum token amounts to withdraw.
Instructions
Remove liquidity from a single STABLE position
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| poolId | Yes | The ID of the stable pool | |
| position | Yes | The position object |
Implementation Reference
- src/mcp/tapp/liquidity-tools.ts:250-271 (handler)Defines the MCP tool 'tapp_remove_single_stable_liquidity' including its Zod input schema and async handler function that delegates to TappAgent.removeSingleStableLiquidity.export const RemoveSingleStableLiquidityTool: McpTool = { name: "tapp_remove_single_stable_liquidity", description: "Remove liquidity from a single STABLE position", schema: { poolId: z.string().describe("The ID of the stable pool"), position: z.object({ positionAddr: z.string().describe("The address of the individual liquidity position"), mintedShare: z.number().describe("The amount of share tokens to burn"), amounts: z.array(z.number()).describe("The minimum token amounts to receive") }).describe("The position object") }, handler: async (agent: TappAgent, input: Record<string, any>) => { const result = await agent.removeSingleStableLiquidity({ poolId: input.poolId, position: input.position }); return { status: "success", transaction: result }; }, };
- Zod schema defining the input parameters for the tool: poolId and position object with positionAddr, mintedShare, and amounts.schema: { poolId: z.string().describe("The ID of the stable pool"), position: z.object({ positionAddr: z.string().describe("The address of the individual liquidity position"), mintedShare: z.number().describe("The amount of share tokens to burn"), amounts: z.array(z.number()).describe("The minimum token amounts to receive") }).describe("The position object") },
- src/mcp/index.ts:48-53 (registration)Registers the RemoveSingleStableLiquidityTool in the TappExchangeMcpTools object export used for MCP server."RemoveSingleAMMLiquidityTool": RemoveSingleAMMLiquidityTool, "RemoveMultipleAMMLiquidityTool": RemoveMultipleAMMLiquidityTool, "RemoveSingleCLMMLiquidityTool": RemoveSingleCLMMLiquidityTool, "RemoveMultipleCLMMLiquidityTool": RemoveMultipleCLMMLiquidityTool, "RemoveSingleStableLiquidityTool": RemoveSingleStableLiquidityTool, "RemoveMultipleStableLiquidityTool": RemoveMultipleStableLiquidityTool,
- src/agent/index.ts:527-546 (helper)TappAgent helper method that calls the SDK to generate transaction payload for removing stable liquidity and submits it via Aptos client.async removeSingleStableLiquidity(params: RemoveSingleStableLiquidityParams): Promise<TransactionResponse> { try { const data = this.sdk.Position.removeSingleStableLiquidity(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' }; } }