# Public vault depositors will receive fewer vault shares until the first payment

Astaria PublicVault.totalAssets returns raw WETH balance before first payment, so depositors get fewer shares than owed after borrowing.

- Payout: Contest reward
- Severity: high
- Program: Astaria
- Credited: 0xRajeev
- Disclosed: 2022-11-07
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2022-10-astaria-judging/issues/173
- Library page: https://bugbountylibrary.com/r/sherlock%3A2022-10-astaria%3AH-22
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:share-inflation

**Target:** PublicVault.sol totalAssets / share accounting
**Root cause:** While PublicVault.last is 0, totalAssets returns the actual WETH balance, which is reduced by outstanding borrows, understating vault assets and thus shares minted to depositors.
**Steps:**
1. Deposit into public vault before any loan payment (last == 0).
2. Borrower takes a loan, reducing vault WETH balance.
3. Call totalAssets: returns reduced raw balance instead of accounting for outstanding debt.
4. New depositor's shares computed against understated assets, receiving fewer shares.
**How found:** Code review of totalAssets logic and the last/yIntercept/slope accounting, noticing the raw balance path is taken until first payment.
**Insight:** In vault share accounting, check whether totalAssets falls back to raw token balance before interest state is initialized; borrowed principal leaving the vault understates assets and dilutes early depositors.
