curve

Executes swaps, liquidity operations, crvUSD loans, and gauge voting on Curve Finance pools.

6|20|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/andresdefi/cryptoskills --skill curve-andresdefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: curve
Source: https://github.com/andresdefi/cryptoskills/tree/main/skills/curve
Command: npx skills add https://github.com/andresdefi/cryptoskills --skill curve-andresdefi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires viem.

What problem does it solve? AI agents frequently mis-integrate Curve Finance because each pool type has a different ABI, token indices are deployment-specific rather than sorted, and Vyper contracts revert with empty error data. This Skill provides verified contract addresses, correct per-pool-type interfaces, and working viem code so agents can interact with Curve without swapping the wrong tokens or calling the wrong functions. ## Core Features & Use Cases - Swapping and Routing: Execute StableSwap, CryptoSwap, and meta pool exchanges with correct index types (int128 vs uint256), ETH-as-msg.value handling, and Curve Router multi-hop routing. - Liquidity Management: Add balanced or single-sided liquidity, remove proportionally or as a single coin, with proper slippage calculation via calc_token_amount and calc_withdraw_one_coin. - crvUSD and Gauge System: Create and monitor LLAMMA soft-liquidation loans, deposit LP tokens into gauges, claim CRV rewards via the Minter, and lock CRV for veCRV to vote on gauge weights. - Use Case: An agent asked to swap 10,000 USDC for USDT verifies token indices via coins(i), quotes with get_dy(), applies slippage tolerance, handles the USDT approval reset quirk, and executes the exchange on 3pool without reverting. ## Quick Start Ask the agent to swap USDC for USDT on Curve 3pool using viem with a 0.1% slippage tolerance.

Frequently Asked Questions about curve

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I swap tokens on Curve Finance using viem?

Call exchange(i, j, dx, min_dy) on the pool contract, where i and j are token indices rather than addresses. Verify indices with coins(i) first, quote the output with get_dy(), apply slippage tolerance for min_dy, and approve the pool to spend your input token.

Why does my Curve swap revert with no error message?

Empty reverts usually mean the ABI does not match the pool type or the wrong index type was used. Older pools like 3pool use int128 for indices while newer factory pools use uint256. Simulate with simulateContract to surface the revert reason before sending.

What is the difference between exchange() and exchange_underlying() on Curve?

exchange() swaps between a meta pool's direct coins, while exchange_underlying() swaps between the meta-asset and the individual tokens inside the basepool. Calling exchange() when you need a basepool token like USDC from a LUSD/3CRV pool will revert.

How does crvUSD soft liquidation work with LLAMMA?

LLAMMA gradually converts collateral to crvUSD as the price moves through your selected bands instead of liquidating instantly at a threshold. If the price recovers, it converts back. Health approaching zero means bands are fully converted, and negative health allows hard liquidation.

Why does my USDT approval transaction fail on Ethereum?

USDT requires the current allowance to be zero before setting a new non-zero approval. Check the existing allowance, reset it to 0 with a separate approve(spender, 0) transaction if needed, then set the new amount.

How do I earn CRV rewards on Curve LP tokens?

Deposit your LP tokens into the pool's gauge contract, which you can find via the MetaRegistry get_gauge() function. Rewards accrue over time and are claimed by calling mint(gauge_addr) on the Minter contract, not on the gauge itself.