All debt in the platform is calculated and tracked in the form of liquidity invariant units. This is done to avoid the effects of price changes on the collateralization ratio and therefore makes the platform impervious to flash loan attacks or other attacks that seek to manipulate the price, which are much easier to implement.

Chart example is for UniswapV2

Chart example is for UniswapV2

The effects of price changes do not affect the collateraliztion because the invariant does not change with changes in the price. In fact, the reserve tokens that are held as collateral area always able to purchase more liquidity invariant units as the price changes

Formula is for UniswapV2

Formula is for UniswapV2

More can be read about the benefits of measuring collateral in this way at the protocol description medium article.

Therefore, in the case of UniswapV2 the invariant is measured as the geometric mean of the reserve assets.

E.g.

L = sqrt(x*y)

For that reason all collateral in the platform is also calculated and tracked in terms of liquidity invariant units (e.g. geometric mean for UniswapV2). Therefore, if a user were to deposit liquidity in the platform providing one token, the collateral is measured as the liquidity invariant of the reserve tokens the liquidity borrowed represents plus the deposited collateral token.

Therefore the formula for the LTV ratio is

LTV = Loan in Liquidity Invariant Units / Collateral in Liquidity Invariant Units

In the case of UniswapV2 that is

LTV = sqrt(x * y) / sqrt((x + x_deposit) * (y + y_deposit))