Section 9 of 18
Comptroller: Market Management
Key takeaway: Compound V2's
Comptrolleris the cross-market accounting layer. It maintains amarketsmapping of supported cTokens with theircollateralFactor(max LTV),listedflag, and per-account membership records, all governed by admin via_supportMarketand_setCollateralFactor. Without an entry in the markets mapping a cToken is invisible to the protocol's solvency math. Every fork modifies these admin paths and they are among the most common places auditors find privilege-escalation bugs.
What You Are Building
You are building the Comptroller's market management layer. This is where the protocol tracks which markets exist, which users have opted into which markets, and the risk parameters for each market. Think of it as the risk engine's configuration layer.
Misconfigured collateral factors and missing access controls on market management are common vulnerabilities in Compound forks. Every parameter you set here directly determines how much risk the protocol takes on.
Your Code
Requirements
Sign up free — keep reading + earn 15 Lynx
Zealynx Academy is free. Track your progress, earn Lynx, and climb the leaderboard.
Sign up free to continueAlready have an account? Log in