curve

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires viem.

What problem does it solve? AI agents frequently mis-integrate Curve Finance because each pool type (StableSwap, CryptoSwap, Meta, Factory) has a different ABI, token indices are deployment-specific rather than sorted, and crvUSD uses LLAMMA soft-liquidation instead of traditional liquidation. This Skill provides verified contract addresses, correct per-pool-type ABIs, and working viem code patterns that prevent wrong-token swaps, silent reverts, and lost funds. ## Core Features & Use Cases - Swaps and Routing: Execute exchanges on StableSwap, CryptoSwap, ETH, and Meta pools with correct index types (int128 vs uint256), plus multi-pool routing through the Curve Router. - Liquidity Management: Add balanced or single-sided liquidity, remove proportionally, as a single coin, or imbalanced, with proper slippage calculation via calc_token_amount and calc_withdraw_one_coin. - crvUSD Loans: Create, monitor, and repay LLAMMA-backed loans with health factor tracking and band configuration. - Gauge System: Deposit LP tokens into gauges, claim CRV rewards via the Minter, lock CRV for veCRV, and vote on gauge weights. - Use Case: An agent asked to swap 10,000 USDC to USDT verifies token indices via coins(i), quotes with get_dy(), applies slippage tolerance, handles USDT's 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, verifying token indices and applying 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 with 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(), and apply a slippage tolerance of 10-30 bps for stableswap pools.

Why does my Curve exchange transaction 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, and Vyper contracts often return empty revert data on mainnet.

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 the wrong one on a meta pool causes a revert.

How does crvUSD soft liquidation work in LLAMMA?

LLAMMA gradually converts collateral to crvUSD as price moves through user-defined bands instead of liquidating instantly at a threshold. If price recovers, the position converts back, and hard liquidation only occurs when health drops below zero.

Why does USDT approval fail before a Curve swap?

USDT requires the current allowance to be reset to zero before setting a new non-zero approval amount. Check the existing allowance first and send an approve(spender, 0) transaction before the new approval.

How do I earn CRV rewards on Curve LP tokens?

Deposit LP tokens into the pool's gauge contract, then claim rewards by calling mint(gauge_addr) on the Minter contract. Rewards depend on the gauge's voting weight, and holding veCRV can boost rewards up to 2.5x.