tapp_add_stable_liquidity
Add token amounts to an existing stable pool on Tapp Exchange using the pool ID and specified token quantities to enhance liquidity.
Instructions
Add liquidity to an existing stable pool
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amounts | Yes | An array of token amounts | |
| poolId | Yes | The ID of the stable pool |
Implementation Reference
- src/mcp/tapp/liquidity-tools.ts:132-149 (handler)Defines the main handler function for the 'tapp_add_stable_liquidity' tool, including input schema validation with Zod and execution logic that delegates to TappAgent.addStableLiquidity method.export const AddStableLiquidityTool: McpTool = { name: "tapp_add_stable_liquidity", description: "Add liquidity to an existing stable pool", schema: { poolId: z.string().describe("The ID of the stable pool"), amounts: z.array(z.number()).describe("An array of token amounts") }, handler: async (agent: TappAgent, input: Record<string, any>) => { const result = await agent.addStableLiquidity({ poolId: input.poolId, amounts: input.amounts }); return { status: "success", transaction: result }; }, };
- src/mcp/index.ts:45-45 (registration)Registers the AddStableLiquidityTool in the central TappExchangeMcpTools object, making it available as an MCP tool."AddStableLiquidityTool": AddStableLiquidityTool,
- src/agent/index.ts:421-440 (helper)Core helper method in TappAgent that generates the transaction payload using the external Tapp SDK and submits it via Aptos client, handling success/error responses.async addStableLiquidity(params: AddStableLiquidityParams): Promise<TransactionResponse> { try { const data = this.sdk.Position.addStableLiquidity(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 schema defining the input parameters for the tool: poolId (string) and amounts (array of numbers).schema: { poolId: z.string().describe("The ID of the stable pool"), amounts: z.array(z.number()).describe("An array of token amounts") },
- src/mcp/index.ts:9-22 (registration)Import statement that brings in the AddStableLiquidityTool for registration in the MCP tools.import { CreateAMMPoolAndAddLiquidityTool, CreateCLMMPoolAndAddLiquidityTool, CreateStablePoolAndAddLiquidityTool, AddAMMLiquidityTool, AddCLMMLiquidityTool, AddStableLiquidityTool, RemoveSingleAMMLiquidityTool, RemoveMultipleAMMLiquidityTool, RemoveSingleCLMMLiquidityTool, RemoveMultipleCLMMLiquidityTool, RemoveSingleStableLiquidityTool, RemoveMultipleStableLiquidityTool } from "./tapp/liquidity-tools";