View deposit.ts on GitHub
Runnable script in the SDK repo.
1. Set up the config
Build a wagmi config with a private key account. (For browser/dApp usage, swap the private key for a connector likeinjected() from @wagmi/core.)
2. Approve the SwapFacility to spend USDC
The SwapFacility needs an ERC-20 allowance to pull USDC out of your account.3. Swap USDC → C0
Callswap on the SwapFacility to mint C0 1:1 (minus any protocol fees).
account.address holds 100 C0 and starts accruing yield automatically.
What’s next
- How to withdraw USDC from C0 — redeem C0 back to USDC
- C0 Token — the full C0 read/write/watch surface
- Swap Adapter — Uniswap V3 routing for USDC/USDT ↔ C0 with built-in slippage protection