prepare_curve_add_liquidity
Create an unsigned Curve add_liquidity transaction for stable_ng plain pools on Ethereum, bundling ERC-20 approvals. Requires deposit amounts and slippage tolerance.
Instructions
Build an unsigned Curve add_liquidity transaction for a stable_ng plain pool on Ethereum. Bundles ERC-20 approvals (one per non-zero deposit slot) before the action call via chainApproval. Pass amounts as a decimal-string array matching the pool's N_COINS (use '0' for slots you're not depositing into — single-coin deposit). Slippage gate is REQUIRED: pass either minLpOut (explicit decimal-string uint256) OR slippageBps (server computes via calc_token_amount * (1 - bps/10000)). v0.1 scope: stable_ng plain pools only — meta pools rejected. Use get_curve_positions to discover valid pool addresses + their coin order before calling this.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet | Yes | 0x EVM wallet address that will sign the tx. | |
| pool | Yes | Pool address (== LP token address on stable_ng). Must be a stable_ng plain pool — meta pools rejected with a clear error in v0.1; use `get_curve_positions` to discover valid pools the wallet has access to. | |
| amounts | Yes | Per-coin deposit amounts as decimal-string-encoded uint256, in the order returned by `get_curve_positions(...).coins`. Length must match the pool's N_COINS. Pass '0' for slots you're not depositing into (single-coin deposit). | |
| minLpOut | No | Explicit minimum LP tokens to receive (decimal-string uint256). Passes through to the pool's `add_liquidity(amounts, min_mint_amount)`. Either `minLpOut` or `slippageBps` is required. | |
| slippageBps | No | Server-side slippage allowance in basis points (e.g. 50 = 0.5%). When set, `minLpOut = calc_token_amount * (1 - slippageBps / 10000)`. Capped at 10% (1000 bps) to prevent accidental wide gates. Either `minLpOut` or `slippageBps` is required. | |
| approvalCap | No | Cap on the ERC-20 approval preceding this action. Omit for "unlimited" (standard DeFi UX — fewer follow-up approvals). Pass "exact" to approve only what this action pulls. Pass a decimal string (e.g. "500") for a specific ceiling in the asset's human units; must be ≥ the action amount, otherwise the transaction would revert. |