What problem does it solve?
Comet Collateral explains how the V3 collateral system works, including multiple collateral assets, per-asset price feeds, borrow and liquidate factors, asset bit vectors, and supply caps, to ensure safe borrowing and liquidation behavior.
Core Features & Use Cases
- Asset configuration: per-asset price feed, decimals, borrowCollateralFactor, liquidateCollateralFactor, liquidationFactor, and supplyCap.
- Collateral accounting: tracks per-user balances and the assetsIn bit vector to determine borrowing power.
- Safe borrowing and liquidation: provides checks for borrowing collateralization and liquidatability based on configured factors.
- Efficient storage and retrieval: describes packed asset storage and AssetInfo lookups.
Quick Start
Add AssetConfig entries for your collateral tokens and use getAssetInfo to verify the stored values. Then run test scenarios to validate borrowing and liquidation logic using borrowCollateralFactor and liquidationFactor.