Contracts
8
8 contracts · 0 libraries · 2 outside
Flows
5
Supply base · Borrow · Absorb (liquidation) · Buy collateral · Change a parameter
Source
0/8
Structure only · BUSL-1.1
Pinned
main
1 repo · commit f766f51
One market per base asset (e.g. USDC): lenders earn interest on the base asset, borrowers post collateral assets that earn nothing, underwater accounts are absorbed by the protocol.
Each Comet is a single market with one borrowable base asset and a fixed list of collateral assets. A user's base balance is one signed principal: positive is supply, negative is borrow; two indexes (supply and borrow) turn principal into present value and move on every accrual. Collateral is only collateral: it can't be borrowed and earns no interest. Liquidation has two steps: anyone calls absorb on an underwater account and the protocol takes its collateral and its debt onto its reserves; later anyone can buyCollateral from the protocol at a discount while reserves are below target. Parameters live in the Configurator; a change means deploying a new Comet implementation through the factory and upgrading the market's proxy through CometProxyAdmin. Main branch, no release tag: the commit is pinned.
LendingEthereum and EVM L2s
Market
Admin and deploy
Rewards
Outside
CometWithExtendedAssetListcontract
The market. Comet for one base asset: supply, withdraw (a withdraw past zero is a borrow), transfer, absorb, buyCollateral, accrue. Storage, configuration and maths come from CometCore, CometStorage and CometConfiguration; less used functions live in the extension (CometExt) reached through the fallback.
39 entry points82 functions14 storage11 eventsCometWithExtendedAssetList.sol:16
Inherits CometMainInterface, CometCore, CometMath, CometStorage, CometConfiguration
Supply the base asset (say USDC) and earn interest; a negative balance is repaid first.
Lender starts
Approves the market, calls supply(baseToken, amount) (or supplyTo / supplyFrom with an operator's permission).
CometWithExtendedAssetList.supply
Entry point; all three variants go to supplyInternal.
CometWithExtendedAssetList.sol:708 on GitHubCometWithExtendedAssetList.supplyInternal
Supply not paused; the operator must have permission from the source. Base asset goes to supplyBase, anything else to supplyCollateral.
CometWithExtendedAssetList.sol:737 on GitHubIERC20NonStandard.transferFrom
The amount is pulled first (doTransferIn) and the balance difference is what counts.
CometWithExtendedAssetList.accrueInternal
Moves the supply and borrow indexes forward for the time elapsed, and the reward tracking indexes.
CometWithExtendedAssetList.sol:270 on GitHubCometWithExtendedAssetList.updateBasePrincipal
The signed principal goes up: debt is repaid first, the rest becomes supply. Totals updated.
CometWithExtendedAssetList.sol:634 on GitHubCometWithExtendedAssetList emit Supply
Emits Supply, and Transfer(0, dst) for the part that became supply.
CometMainInterface.sol:37 on GitHub0/19 checked
Mapped: the extended-asset-list Comet market (the current main branch), its extension, collateral list, configurator, factory, proxy admin and rewards. Not mapped: bulkers, bridges and receivers, liquidator bots, market update proposers, older Comet without extended asset list. The repository has no release tags; the commit is pinned.
forge Version: 1.5.1-stable