Problem
TotalDeposits tracks principal while TotalAssets includes yield. After update_total_assets(), TVL cap checks and get_total_deposits() can disagree with share pricing.
Scope
deposit, withdraw, update_total_assets, cap guards
Acceptance criteria
- Document the relationship between
TotalDeposits, TotalAssets, and shares.
- Either sync
TotalDeposits on yield updates or stop using it for caps where TotalAssets is correct.
- Regression tests for deposit → yield → withdraw → cap check.
Problem
TotalDepositstracks principal whileTotalAssetsincludes yield. Afterupdate_total_assets(), TVL cap checks andget_total_deposits()can disagree with share pricing.Scope
deposit,withdraw,update_total_assets, cap guardsAcceptance criteria
TotalDeposits,TotalAssets, and shares.TotalDepositson yield updates or stop using it for caps whereTotalAssetsis correct.