compound

Installation
SKILL.md

Compound V3 (Comet)

Compound V3 (codenamed "Comet") is a lending protocol where each market has exactly one borrowable base asset (e.g., USDC or WETH). Users supply collateral to borrow the base asset, or supply the base asset to earn interest. Unlike shared-pool models, each Comet deployment is a standalone contract with its own collateral configuration, interest rate model, and risk parameters.

What You Probably Got Wrong

LLMs conflate V2 and V3 constantly. Compound V3 is a ground-up rewrite with a completely different architecture. These corrections are non-negotiable.

  • V3 (Comet) is NOT V2 — completely different architecture. V3 has one borrowable asset per market (e.g., a USDC market, a WETH market). V2 had shared pools where every asset was both borrowable and suppliable. If you see cToken, mint(), redeem(), or Comptroller, you are writing V2 code. Stop.
  • cTokens do NOT exist in V3. There is no mint/redeem flow. You call supply() and withdraw() directly on the Comet contract. There are no ERC-20 receipt tokens for collateral positions.
  • Supplying the base asset earns interest. Supplying collateral does NOT. If you supply USDC to the USDC market, you earn interest. If you supply WETH as collateral to the USDC market, it earns zero yield — it only backs your borrow.
  • supply() with the base asset = lending. supply() with collateral = collateralize. Same function, different behavior depending on whether the asset is the market's base asset or a configured collateral asset.
  • withdraw() on the base asset when you have a borrow = repaying debt, not withdrawing. If your base asset balance is negative (you borrowed), calling withdraw() does not give you tokens — it increases your debt. Use supply() to repay.
  • Liquidation uses absorb() not liquidateBorrow(). The protocol absorbs the underwater position, socializing bad debt if any, then sells the seized collateral via buyCollateral() at a discount. This is a two-step process, not an atomic liquidation.
  • Interest accrues per-second in V3, not per-block like V2. The baseTrackingSupplySpeed and baseTrackingBorrowSpeed are per-second rates. Block-based assumptions from V2 will produce wrong calculations.
  • Account balances can be negative (borrowed). balanceOf(user) returns the base asset balance which is zero for pure collateral suppliers. Use borrowBalanceOf(user) for outstanding debt and collateralBalanceOf(user, asset) for collateral amounts.
  • Comet is not upgradeable in the traditional proxy sense. It uses a Configurator + ProxyAdmin pattern where configuration changes deploy a new implementation and the proxy is pointed to it. The proxy address stays constant.
  • COMP rewards are claimed through CometRewards, not Comet itself. Call CometRewards.claim(comet, account, true) to claim accrued COMP. The Comet contract tracks reward accrual but does not distribute tokens.
Installs
1
First Seen
Aug 4, 2026
compound — justaname-id/cryptoskills