# Position valuation (technical)

All Uniswap V3 NFTs deposited as collateral are evaluated independently. The total collateral value is equal to the sum of all NFTs collateral values.

$$
C = \sum{c\_i}
$$

Each Uniswap V3 position contains 2 ERC20 tokens, whose ratio changes during market volatility. Protocol relies on the Chainlink oracle for obtaining prices of individual tokens, with a possibility of manually setting fallback prices in the event Chainlink outage.

The collateral value is calculated using the following approach:

$$
C = \sum{c\_i} = \sum{p\_x(a\_x + f\_x) + p\_y(a\_y + f\_y)}
$$

Where:

* $$p\_x$$is a normalized token price returned from Chainlink
* $$a\_x$$ is an amount of token $$x$$ in Uniswap position, derived from the amount of Uniswap liquidaty and price ration $$p\_y/p\_x$$
* $$f\_x$$ is an amount of accumulated LP fees within position

Borrower max debt limit is calculated using collateral-specific borrow thresholds:

$$
C\_b = \sum{t\_{b,i}c\_i} = \sum t\_{b,i}({p\_x(a\_x + f\_x) + p\_y(a\_y + f\_y))}
$$

Where:

* $$t\_{b,i}$$ - is a borrow threshold set by governance for collateral $$i$$&#x20;

Borrower is not immediately liquidated once max debt limit is exceeded, instead higher liquidation limit is used for determining if position is subject to liquidation.

$$
C\_b \leq C\_l = \sum{t\_{l,i}c\_i} = \sum t\_{l,i}({p\_x(a\_x + f\_x) + p\_y(a\_y + f\_y))}
$$

Where:

* $$t\_{b,i} \leq t\_{l,i}$$ - is a liquidation threshold set by governance for collateral $$i$$

### Price manipulation safety

It’s important to note that evaluated collateral value of Uniswap V3 positions does not depend on the current spot price in the Uniswap V3 pool, and instead is purily based on Chainlink oracle responses. This makes it impossible to manipulate price valuations using sandwiching or other attacks, however it introduces small differences between valuations in BOB CDP and in Uniswap UI.

In practice, this means that BOB CDP valuations can be up to \~0.1% (based on conducted backtesting) smaller than numbers shown in Uniswap UI, making such differences barely noticable.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bob-docs.zkbob.com/bob-cdp/technical-docs/position-valuation-technical.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
