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?