Protocols / Lending
Compound V2
Legacy pooled money market on Ethereum (Comptroller + cTokens). As of late 2026 every V2 market has supply (mint) and borrow paused, so agents use it to read positions, redeem cTokens, repay or liquidate borrows and claim previously accrued COMP. New lending happens on Compound III (Comet).
On-chainEVM26 contractsWebsite · Docs
get_protocol({ "protocol": "compound-v2" })Risks an agent should know
- Legacy version: Compound V2 is being wound down; the current product is Compound III (Comet), which has separate per-base-asset deployments not covered here.
- On-chain state checked 2026-11-25: mintGuardianPaused and borrowGuardianPaused are true for all 20 listed markets, so mint() and borrow() revert; redeem, repay and liquidation still work. COMP supply/borrow speeds are 0 on every market.
- Deprecated markets (isDeprecated = true: cUSDT, cZRX, cCOMP, cTUSD, cUSDP, cFEI, cREP, cSAI) have collateral factor 0 and 100% reserve factor, so open borrows there can be liquidated in full.
- Collateral factors on the remaining markets (e.g. cUSDC 84.5%, cDAI 83.5%, cETH 82.5% on 2026-11-25) can be cut by governance at any time, which can push accounts into shortfall; closeFactor is 50% and liquidation incentive 8%.
- Liquidity risk: redeem fails if the market's getCash() is below the requested amount (cash is lent out to borrowers).
- Many write functions return a non-zero error code instead of reverting (CErc20 mint/redeem/borrow/repay). Always check the return value or the Failure event; cETH reverts instead.
- Oracle risk: prices come from the Compound v2 Price Feed (Chainlink feeds, configurable by the Compound community multisig); deprecated FEI, REP and SAI use fixed prices.
- Governance: the Comptroller and all markets are administered by the Timelock controlled by COMP holders via GovernorBravo; parameters, pauses and implementations can change by vote.
- Past incident (26 Nov 2020): a brief DAI spike to ~$1.30 on Coinbase, which fed the then-oracle, caused roughly $89M of liquidations on Compound; affected users were not compensated.
- Past incident (29-30 Sep 2021): a bug in the Comptroller upgrade from Proposal 62 over-distributed COMP rewards (tens of millions of USD); user deposits were not at risk, but the fix needed further governance proposals (63/64) over about a week.
What an agent can do
| withdraw-supply | Withdraw supplied assets from a V2 market cToken.redeemUnderlying(amount in underlying units) or cToken.redeem(cTokenAmount). Check Comptroller.getHypotheticalAccountLiquidity(account, cToken, redeemTokens, 0) if you also borrow, and cToken.getCash() for available liquidity. Check the uint return value: 0 = success. |
| repay | Repay a V2 borrow ERC-20 markets: underlying.approve(cToken, amt) then cToken.repayBorrow(amt) (2^256-1 = full). cETH: Maximillion.repayBehalf(borrower) with a little more ETH than borrowBalanceCurrent (excess refunded). |
| check-health | Read an account's position Comptroller.getAccountLiquidity(account) -> (err, liquidity, shortfall) in USD 1e18; per market cToken.getAccountSnapshot(account); collateral factors via Comptroller.markets(cToken). |
| liquidate | Liquidate an account with shortfall When getAccountLiquidity shows shortfall > 0: approve the borrowed underlying, then cTokenBorrowed.liquidateBorrow(borrower, repayAmount <= closeFactor x borrow, cTokenCollateral); you receive collateral cTokens, then redeem them. |
| claim-comp | Claim accrued COMP Comptroller.claimComp(holder) (or claimComp(holder, [cTokens])). Read Comptroller.compAccrued(holder) first; new COMP emissions on V2 are zero. |
| exit-collateral | Remove a market from collateral Comptroller.exitMarket(cToken) once nothing is borrowed from it and the account stays healthy. |
Contracts
ethereum · chain id 1
| Contract | Address | Key functions | Try |
|---|---|---|---|
| Comptroller (Unitroller proxy) other · proxy | 0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B source | writeenterMarkets(address[]) writeexitMarket(address) readgetAccountLiquidity(address) readgetHypotheticalAccountLiquidity(address,address,uint256,uint256) readgetAssetsIn(address) readmarkets(address) readgetAllMarkets() readmintGuardianPaused(address) +9 more via get_protocol | Full ABI |
| cETH - Compound V2 market for ETH pool | 0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5 source | writemint() writeredeem(uint256) writeredeemUnderlying(uint256) writerepayBorrow() writerepayBorrowBehalf(address) writeliquidateBorrow(address,address) | Full ABI |
| cUSDC - Compound V2 market for USDC pool | 0x39AA39c021dfbaE8faC545936693aC917d5E7563 source | writemint(uint256) writeredeem(uint256) writeredeemUnderlying(uint256) writeborrow(uint256) writerepayBorrow(uint256) writerepayBorrowBehalf(address,uint256) writeliquidateBorrow(address,uint256,address) writebalanceOfUnderlying(address) +9 more via get_protocol | Full ABI |
| cDAI - Compound V2 market for DAI pool · proxy | 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643 source | Full ABI | |
| cUSDT - Compound V2 market for USDT (deprecated market) pool · proxy | 0xf650C3d88D12dB855b8bf7D11Be6C55A4e07dCC9 source | Full ABI | |
| cWBTC2 - Compound V2 market for WBTC (current WBTC market; on-chain symbol cWBTC) pool · proxy | 0xccF4429DB6322D5C611ee964527D42E5d685DD6a source | Full ABI | |
| cWBTC (legacy) - Compound V2 market for WBTC (original market, superseded by cWBTC2) pool | 0xC11b1268C1A384e55C48c2391d8d480264A3A7F4 source | Full ABI | |
| cCOMP - Compound V2 market for COMP (deprecated market) pool · proxy | 0x70e36f6BF80a52b3B46b3aF8e106CC0ed743E8e4 source | Full ABI | |
| cUNI - Compound V2 market for UNI pool · proxy | 0x35A18000230DA775CAc24873d00Ff85BccdeD550 source | Full ABI | |
| cLINK - Compound V2 market for LINK pool · proxy | 0xFAce851a4921ce59e912d19329929CE6da6EB0c7 source | Full ABI | |
| cAAVE - Compound V2 market for AAVE pool · proxy | 0xe65cdB6479BaC1e22340E4E755fAE7E509EcD06c source | Full ABI | |
| cMKR - Compound V2 market for MKR pool · proxy | 0x95b4eF2869eBD94BEb4eEE400a99824BF5DC325b source | Full ABI | |
| cSUSHI - Compound V2 market for SUSHI pool · proxy | 0x4B0181102A0112A2ef11AbEE5563bb4a3176c9d7 source | Full ABI | |
| cYFI - Compound V2 market for YFI pool · proxy | 0x80a2AE356fc9ef4305676f7a3E2Ed04e12C33946 source | Full ABI | |
| cBAT - Compound V2 market for BAT pool | 0x6C8c6b02E7b2BE14d4fA6022Dfd6d75921D90E4E source | Full ABI | |
| cZRX - Compound V2 market for ZRX (deprecated market) pool | 0xB3319f5D18Bc0D84dD1b4825Dcde5d5f7266d407 source | Full ABI | |
| cTUSD - Compound V2 market for TUSD (deprecated market) pool · proxy | 0x12392F67bdf24faE0AF363c24aC620a2f67DAd86 source | Full ABI | |
| cUSDP - Compound V2 market for USDP (deprecated market) pool · proxy | 0x041171993284df560249B57358F931D9eB7b925D source | Full ABI | |
| cFEI - Compound V2 market for FEI (deprecated, fixed oracle price) pool · proxy | 0x7713DD9Ca933848F6819F38B8352D9A15EA73F67 source | Full ABI | |
| cREP - Compound V2 market for REP (deprecated, fixed oracle price) pool | 0x158079Ee67Fce2f58472A96584A73C7Ab9AC95c1 source | Full ABI | |
| cSAI - Compound V2 market for SAI (single-collateral DAI; deprecated, fixed oracle price; on-chain symbol cDAI) pool | 0xF5DCe57282A584D2746FaF1593d3121Fcac444dC source | Full ABI | |
| Compound v2 Price Feed (PriceOracle, Chainlink-based) other | 0x8CF42B08AD13761345531b839487aA4d113955d9 source | readgetUnderlyingPrice(address) | Full ABI |
| Maximillion (repay full cETH borrow) router | 0xf859A1AD94BcF445A406B892eF0d3082f4174088 source | writerepayBehalf(address) | Full ABI |
| COMP token token | 0xc00e94Cb662C3520282E6f5717214004A7f26888 source | readbalanceOf(address) writedelegate(address) readgetCurrentVotes(address) | Full ABI |
| GovernorBravo (Compound governance) governance · proxy | 0xc0Da02939E1441F497fd74F78cE7Decb17B66529 source | Full ABI | |
| Timelock (admin of the Comptroller and markets) governance | 0x6d903f6003cca6255D85CcA4D3B5E5146dC33925 source | Full ABI |
Notes
Addresses are taken from the mainnet network config embedded in the official v2 docs (docs.compound.finance/v2 now redirects to docs.compound.xyz/v2/), which matches compound-finance/compound-protocol networks/mainnet.json; the Price Feed address is from the v2 Prices docs page and equals Comptroller.oracle() on-chain; Maximillion is from the official networks/mainnet.json. keyFunctions are listed once on cUSDC (CErc20 interface) and on cETH (payable variants); all other cTokens share the cUSDC interface (cTokens have 8 decimals). Delegator markets (proxy: true) are CErc20Delegator proxies. cWBTC (0xC11b...) is the original WBTC market and cWBTC2 (0xccF4...) the later one; both report symbol cWBTC. Left out: CompoundLens, interest-rate models, Reservoir and older Comptroller implementations (listed in mainnet.json but not needed by agents), and all Compound III (Comet) contracts, which belong to a separate protocol entry. The old api.compound.finance REST API is not listed because it is not documented as live.
Sources
- https://docs.compound.xyz/v2/
- https://docs.compound.finance/v2/
- https://docs.compound.xyz/v2/ctokens/
- https://docs.compound.xyz/v2/comptroller/
- https://docs.compound.xyz/v2/prices/
- https://raw.githubusercontent.com/compound-finance/compound-protocol/master/networks/mainnet.json
- https://github.com/compound-finance/compound-protocol/blob/master/contracts/CToken.sol
- https://github.com/compound-finance/compound-protocol/blob/master/contracts/CErc20.sol
- https://github.com/compound-finance/compound-protocol/blob/master/contracts/CEther.sol
- https://github.com/compound-finance/compound-protocol/blob/master/contracts/Comptroller.sol
- https://api.llama.fi/protocol/compound-v2
- https://defillama.com/protocol/compound-v2
- https://www.theblock.co/post/85850/dai-compound-dydx-liquidations-defi
- https://decrypt.co/49657/oracle-exploit-sees-100-million-liquidated-on-compound
- https://www.theblock.co/post/119086/compound-bug-comp-risk-misreward
- https://ethereum-rpc.publicnode.com
Researched 2026-11-25. Addresses are copied from the official sources above; check them before moving large amounts.