Lend Assets
Depositing USDC for Lending
Type
Name
Instruction
// Get the cUSDC contract with signer
const cUSDC = new ethers.Contract(ADDRESSES.CUSDC, CTOKEN_ABI, signer);
// Get the USDC contract with signer
const usdc = new ethers.Contract(ADDRESSES.USDC, ERC20_ABI, signer);
// Format amount (USDC has 6 decimals)
const depositAmount = ethers.utils.parseUnits("1000", 6); // 1000 USDC
// Approve eUSDC to spend USDC
await usdc.approve(ADDRESSES.CUSDC, depositAmount);
// Deposit USDC for lending
await cUSDC.deposit(depositAmount, userAddress);Last updated
Was this helpful?