# SiloConnector _getPositionTVL miscalculate the TVL position

SiloConnector._getPositionTVL summed distinct Silo share tokens (collateral, collateralOnly, debt) and priced them as underlying, corrupting vault TVL and share price.

- Payout: Audit contest
- Severity: high
- Program: NOYA
- Found by: AlexCzm
- Disclosed: 2025-02-17
- Write-up quality: 7/10
- Original: https://github.com/code-423n4/2024-04-noya-findings/issues/938
- Library page: https://bugbountylibrary.com/r/c4%3A2024-04-noya%3AH-15
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:oracle-manipulation

**Target:** SiloConnector._getPositionTVL accounting in AccountingManager vault
**Root cause:** The connector adds balances of collateralToken and collateralOnlyToken (distinct share tokens with different exchange rates) and multiplies share-token amounts by the underlying asset price instead of converting shares to underlying first.
**Steps:**
1. Read SiloConnector._getPositionTVL: it loops silo.getAssetsWithState() assets.
2. For each asset it sums IERC20(collateralToken).balanceOf(this) + IERC20(collateralOnlyToken).balanceOf(this) as depositAmount, and debtToken.balanceOf(this) as borrowAmount.
3. It then multiplies these share-token balances by _getValue(assets[i], base, 1e18), the underlying price.
4. tvl = totalDepositAmount - totalBAmount is returned to AccountingManager and feeds the 4626 share price.
5. Because share tokens have different exchange rates vs underlying, the computed TVL is wrong, mispricing mint/redeem of vault shares.
**How found:** Code review of the connector's TVL accounting against Silo's AssetStorage struct semantics: noticing collateralToken, collateralOnlyToken and debtToken are separate share tokens with distinct exchange rates, yet were summed and priced as underlying.
**Exploitation:** No direct theft path described; the miscalculated TVL feeds AccountingManager total assets and the ERC4626 share price, so shares can be minted or redeemed at an incorrect price, harming depositors/withdrawers.
**Insight:** When a connector values positions in a lending protocol, check whether balanceOf returns share tokens rather than underlying; each share class (collateral, collateral-only, debt) has its own exchange rate and must be converted before pricing.

