Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.
Planned Implementation
Swaps
Liquidity
Resources
Related
- uniswap-v4 — General AMM
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Stablecoin and pegged asset swaps with Curve
import { Curve } from './Curve.js';
const curve = Curve({ provider });
// Swap stablecoins
await curve.exchange({
pool: THREE_POOL,
i: 0, // DAI
j: 1, // USDC
dx: parseUnits('1000', 18),
minDy: parseUnits('990', 6),
signer,
});
// Add liquidity
await curve.addLiquidity({
pool: THREE_POOL,
amounts: [parseUnits('1000', 18), parseUnits('1000', 6), parseUnits('1000', 6)],
minMintAmount: 0n,
signer,
});
// Remove liquidity
await curve.removeLiquidity({
pool: THREE_POOL,
amount: lpBalance,
minAmounts: [0n, 0n, 0n],
signer,
});
Was this page helpful?
