Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Why this matters
lending_pool/src/lib.rs computes total_assets for both minting (total_assets_before in deposit) and redemption (calc_assets_to_redeem in redeem_shares/get_deposit/get_share_price) from read_pool_balance, the raw TokenClient::balance of the contract. loan_manager approve_loan transfers tokens out of the pool and repayments/seized collateral transfer them back in, so the share price swings with outstanding loans and anyone can inflate it by transferring tokens to the pool address, decoupling shares from tracked TotalDeposits.
Acceptance criteria
Files to touch
Out of scope
- Adding an oracle for token pricing
- Multi-asset rebalancing
Why this matters
lending_pool/src/lib.rs computes total_assets for both minting (total_assets_before in deposit) and redemption (calc_assets_to_redeem in redeem_shares/get_deposit/get_share_price) from read_pool_balance, the raw TokenClient::balance of the contract. loan_manager approve_loan transfers tokens out of the pool and repayments/seized collateral transfer them back in, so the share price swings with outstanding loans and anyone can inflate it by transferring tokens to the pool address, decoupling shares from tracked TotalDeposits.
Acceptance criteria
Files to touch
Out of scope