# _getPositionTVL of UNIv3Connector wrongly assumes ownership of all liquidity of the provided ticks inside positionManager

UNIv3Connector._getPositionTVL reads pool.positions by keccak(positionManager,tL,tU), counting all liquidity in those ticks as the vault's, inflating TVL.

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

**Target:** UNIv3Connector._getPositionTVL / Uniswap V3 pool.positions
**Root cause:** TVL is derived from pool.positions keyed only by (positionManager, tickLower, tickUpper), which aggregates liquidity from all LPs sharing those ticks, not just the connector's NFT position.
**Steps:**
1. Call _getPositionTVL with a HoldingPI whose additionalData encodes (tL, tU, fee).
2. Observe key = keccak256(abi.encodePacked(positionManager, tL, tU)).
3. pool.positions(key) returns total liquidity across all positions at those ticks, including other LPs.
4. getAmountsForLiquidity converts that inflated liquidity to token amounts, overstating TVL.
**How found:** Code reading of _getPositionTVL: noticed the positions key omits the tokenId/NFT owner, so the pool-level liquidity lookup cannot distinguish the connector's position from other LPs in the same tick range.
**Exploitation:** No direct theft described; inflated TVL misrepresents vault solvency/assets, potentially enabling over-borrowing or mispriced accounting against the protocol.
**Insight:** When valuing Uniswap V3 LP positions, never trust pool.positions(tickKey) alone—it aggregates all LPs at those ticks; resolve the specific tokenId via the position manager's positions() getter to isolate owned liquidity.

## Proof of concept (copied exactly from the original report)

**TVL function reading pool.positions by tick key**

```
function _getPositionTVL(HoldingPI memory p, address base) public view override returns (uint256 tvl) {
        PositionBP memory positionInfo = registry.getPositionBP(vaultId, p.positionId);
        uint256 tokenId = abi.decode(p.data, (uint256));
        (address token0, address token1) = abi.decode(positionInfo.data, (address, address));
        uint256 amount0;
        uint256 amount1;
        (int24 tL, int24 tU, uint24 fee) = abi.decode(p.additionalData, (int24, int24, uint24));
        {
            IUniswapV3Pool pool = IUniswapV3Pool(factory.getPool(token0, token1, fee));
>>>         bytes32 key = keccak256(abi.encodePacked(positionManager, tL, tU));

>>>         (uint128 liquidity,,, uint128 tokensOwed0, uint128 tokensOwed1) = pool.positions(key);

            (uint160 sqrtPriceX96,,,,,,) = pool.slot0();
            (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(
                sqrtPriceX96, TickMath.getSqrtRatioAtTick(tL), TickMath.getSqrtRatioAtTick(tU), liquidity
            );
            amount0 += tokensOwed0;
            amount1 += tokensOwed1;
        }

        tvl += valueOracle.getValue(token0, base, amount0);
        tvl += valueOracle.getValue(token1, base, amount1);
```

