For more info about CAP protocol check the docs.
cUSD is an upgradeable proxy on Mainnet. Its roles are stored in AccessStorageLocation at 0xb413d65cb88f23816c329284a0d3eb15a99df7963ab7402ade4c5da22bff6b00, which points to the AccessControl proxy. The sole default admin is the Timelock contract, which has a minimum 24-hour delay.
Internal timelock monitoring alerts on transactions queued to the Mainnet Timelock.
The hourly status.py monitor checks the stcUSD contract:
- The contract's cUSD balance must cover
totalAssets() + lockedProfit(). All values are pinned to the same block so profit unlocking between RPC calls cannot create a false deficit. A deficit sends one critical alert; recovery re-arms the monitor. convertToAssets(1e18)must not decrease between runs. It is read at the same pinned block as the backing values. Any decrease sends a critical alert.
stcUSD has no withdrawal pause, cooldown, queue, allowlist, or withdrawal-cap override. Its 86,400-second lockDuration only vests newly received profit. The duration is set during the one-time initializer and has no setter. Changing it requires a UUPS upgrade, whose sole live upgrade-role holder is the monitored CAP TimelockController.
The script liquidity.py is run daily via the monitoring runner.
It monitors withdrawable liquidity for the CAP protocol's cUSD contract 0xcCcc62962d17b8914c62D74FfB843d73B2a3cccC:
- Fetches all assets from the cUSD contract
- For each asset, calculates total withdrawable liquidity:
- Withdrawable amount from the fractional reserve vault (via
maxWithdrawfor the cUSD contract) - Direct token balance held by the cUSD contract
- Withdrawable amount from the fractional reserve vault (via
- Sums normalized values across all assets for both withdrawable liquidity and total TVL. TVL is the sum of cUSD's
totalSupplies(asset)values, including borrowed assets. Both totals value backing assets at par after adjusting for token decimals; all reads are pinned to the same block. - Sends Telegram alert when total withdrawable liquidity is below 10% of total TVL (high) or below 3% (critical). Exactly 10% does not alert; exactly 3% sends high. Alerts include each asset's withdrawable amount, total withdrawable liquidity, total TVL, the percentage, and the breached threshold amount. A zero TVL skips the ratio check.
- RedStone Price Feed for cUSD_FUNDAMENTAL if the value falls below 99980000, telegram alert is sent. Tenderly alert
Large mint monitoring is integrated into liquidity.py.
It intentionally does not scan events. Instead, it compares cached totalSupply values and alerts when the increase is above:
CUSD_LARGE_MINT_THRESHOLD_PERCENT(default:0.05, i.e.5%of previoustotalSupply)
The daily supply baseline expires after 36 hours and initializes from the next valid observation, preventing multiple missed daily runs from being treated as one large mint interval.