swap_curve
Swap between two assets on a Curve StableSwap pool with minimal slippage. Ideal for stablecoin conversions like USDC to USDT or DAI.
Instructions
Swaps between two assets on a Curve StableSwap pool. Ideal for stablecoin-to-stablecoin conversions (USDC↔USDT↔DAI) with minimal slippage. The caller must supply the pool address and the indices of the input/output tokens within that pool. Assumes fromToken has already been approved to the pool; simulation will fail clearly if approval is missing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pool | Yes | Curve pool contract address. | |
| from_token_index | Yes | Index (0, 1, 2, ...) of the input token within the pool. | |
| to_token_index | Yes | Index of the output token within the pool. | |
| from_token_address | Yes | ERC-20 address of the input token. | |
| to_token_address | Yes | ERC-20 address of the output token. | |
| amount_in | Yes | Amount of input token in human-readable units. | |
| min_amount_out | Yes | Minimum acceptable amount of output token (slippage protection). | |
| chain_id | No | Chain ID. Default: 1 (Ethereum mainnet). |