tapp_remove_multiple_stable_liquidity
Remove liquidity from multiple stable pool positions on Tapp Exchange. Specify pool ID, position addresses, share tokens to burn, and minimum token amounts to receive for efficient withdrawal.
Instructions
Remove liquidity from multiple STABLE positions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| poolId | Yes | The ID of the stable pool | |
| positions | Yes | An array of position objects |
Implementation Reference
- src/mcp/tapp/liquidity-tools.ts:284-293 (handler)The handler function for the 'tapp_remove_multiple_stable_liquidity' MCP tool, which delegates to the TappAgent's removeMultipleStableLiquidity method and formats the response.handler: async (agent: TappAgent, input: Record<string, any>) => { const result = await agent.removeMultipleStableLiquidity({ poolId: input.poolId, positions: input.positions }); return { status: "success", transaction: result }; },
- Zod input schema defining the parameters: poolId and array of positions with positionAddr, mintedShare, and amounts.schema: { poolId: z.string().describe("The ID of the stable pool"), positions: z.array(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("An array of position objects") },
- src/mcp/index.ts:53-53 (registration)Registration of the tool object in the central TappExchangeMcpTools export under the key 'RemoveMultipleStableLiquidityTool'."RemoveMultipleStableLiquidityTool": RemoveMultipleStableLiquidityTool,
- src/agent/index.ts:548-567 (helper)TappAgent helper method that uses the external SDK to generate transaction payload for removing multiple stable liquidity and submits it via Aptos client.async removeMultipleStableLiquidity(params: RemoveMultipleStableLiquidityParams): Promise<TransactionResponse> { try { const data = this.sdk.Position.removeMultipleStableLiquidity(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' }; } }