
Compound V3 Lending
Supply USDC into Compound V3 Comet to earn interest, or deposit collateral to borrow.
CategoryDeFi
ChainsBASE_ETHETHSETH
C
Cobo· Author
38 views·21 uses
Overview
Supply USDC into Compound V3 Comet to earn interest, or deposit collateral to borrow.
Facts
•comet_usdc (BASE_ETH):
0xb125E6687d4313864e53df431d5425969c15Eb2F•comet_usdc (ETH):
0xc3d688B66703497DAA19211EEdff47f25384cdc3•comet_usdc (SETH):
0xAec1F48e02Cfb822Be958B68C7957156EB3F0b6e•base asset: USDC only (earns interest; collateral does not)
•target_in: comet_usdc + USDC contract
Compound V3 Comet:
solidity
function supply(address asset, uint256 amount) external;function withdraw(address asset, uint256 amount) external;function isSupplyPaused() external view returns (bool);function isWithdrawPaused() external view returns (bool);
ERC-20 USDC:
solidity
function approve(address spender, uint256 amount) external returns (bool);function allowance(address owner, address spender) external view returns (uint256);
Preflight Checks
Run all checks via eth_call on the Comet contract before submitting transactions.
### 1 · Supply / withdraw paused
comet.isSupplyPaused() and comet.isWithdrawPaused() — if true, the respective operation will revert; abort until protocol unpauses.
### 2 · USDC allowance
usdc.allowance(agentAddress, comet) — if >= amount, skip the approve step.
Typical Flows
Supply — up to 2 tx:
1.Check
allowance(agentAddress, comet) on USDC; skip approve if sufficient2.
approve(comet, amount) on USDC contract3.
supply(usdc, amount) on CometWithdraw — 1 tx:
1.
withdraw(usdc, amount) on Comet — pass type(uint256).max to withdraw full balancePolicy Controls
•Approve must confirm before supply: Supply reverts if approve is unconfirmed.
•Approve target is the USDC contract, not Comet: Call
approve on the USDC token address; approving the Comet contract itself will not grant the needed allowance.•Liquidation risk: Borrowed positions liquidate when collateral drops below threshold. Supply-only (no borrow) = no liquidation risk.
•Policy denial: Parse reason (per-tx limit vs daily cap); retry with compliant params.
•Not applicable for: non-USDC tokens as the yield-earning base asset (collateral earns no interest)
•Testnet: No real value; use Compound's Sepolia test token faucet. Token address mismatch reverts:
comet_usdc on Sepolia expects Compound's test WETH at 0x2D5ee574e710219a521449679A4A7f2B43f046ad; using standard Sepolia WETH9 (0xfFf9...) can revert without a readable reason.•Partial reference: use web search for unlisted tokens, contracts, parameters, or up-to-date addresses
References
•Docs:
https://docs.compound.finance — Compound III (Comet) ABI, supply/withdraw flow, base asset interest, Comet addresses per chain.