# Dynamics and Stability of Value of Uniswap V3 LP Tokens

We will demonstrate the value dynamics of a generic Uniswap V3 LP position and illustrate its relatively higher stability of value than its underlying ERC20 token in the arch of following context: ETH is at $1000. User provides liquidity of 1 ETH plus 1596.12 USDT within $500-1500 price range.

- 1.If ETH falls down to $500, the LP position becomes 3.26 ETH + 0 USDT.
**Note even if ETH continues to fall further from this point, the LP position will still be 3.26 ETH as the lower bound of the liquidity provision boundary is hit and all liquidity is depleted.** - 2.If ETH jumps to $1500, the LP position becomes 0 ETH + 2820.86 USDT. Again, even if ETH continues to increase, the LP position will still be redeemable to 2820.86 USDT.

The comparison between providing liquidity to Uniswap V2, V3 and holding ETH is plotted below against ETH price movement spectrum.

Untitled (2).png

It is clear from the plot above that when the collateral value depreciates (approaching liquidation), the LP token is a less risky asset than its underlying risky asset, as the value of the LP token drops slower than its underlying risky asset when its price drops, regardless of the configuration of the LP position. Therefore, the LP token collateral has better stability in its value than its underlying risky asset (i.e. blue and orange lines are above the grey line when ETH price drops).

However, there are two issues related to accepting Uniswap V3 LP tokens as collateral on our platform and their respective solution:

**Issue #1:** Each LP token represents a unique position expressed as a function of liquidity provision range and liquidity, and it is impossible to include every Uniswap V3 LP token into the price oracle directly. How would we manage loan origination and liquidation triggering, both of which require an accurate price quote of the LP token?

**Issue #1:**Each LP token represents a unique position expressed as a function of liquidity provision range and liquidity, and it is impossible to include every Uniswap V3 LP token into the price oracle directly. How would we manage loan origination and liquidation triggering, both of which require an accurate price quote of the LP token?

**Solution: Updating Uniswap V3 LP token value by updating the numbers of each asset in the LP position and the sum of their values as underlying risky asset price updates.**As documented in the Uniswap V3 LP Token Analyzer page, the numbers of the two assets in the LP position can be obtained on-chain. Then the value of the LP position can be derived by:

$V(LP)=x*P_{ETH}+y*P_{USDT}+unclaimed\_fee$

where

$x$

is the number of risky asset tokens (ETH) in the LP position, $y$

is the number of stablecoins in the position (USDT), $P_{ETH}$

and $P_{USDT}$

are the prices of ETH and USDT respectively, and $unclaimed\_fee$

is the unclaimed trading fee earned by the LP position.// this is the price calculation code

function getTokenPrice(uint256 tokenId) public view returns (uint256) {

UinswapV3PositionData memory positionData = _getPositionData(tokenId);

PairOracleData memory oracleData = _getOracleData(positionData);

(

uint256 liquidityAmountA,

uint256 liquidityAmountB

) = _getLiquidityAmount(oracleData.sqrtPriceX96, positionData);

(uint256 feeAmountA, uint256 feeAmountB) = _getLpFeeAmount(

positionData

);

return

(((liquidityAmountA + feeAmountA) * oracleData.tokenAPrice) /

10**oracleData.tokenADecimal) +

(((liquidityAmountB + feeAmountB) * oracleData.tokenBPrice) /

10**oracleData.tokenBDecimal);

}

Solution: As the LP composition could quickly turn into 100% of either asset of the LP asset pair, an effective and safe choice is to use the minimum collateral factors and liquidation thresholds of the two assets as the collateral factor and liquidation threshold for the LP token. E.g. for an ETH/USDT LP, its collateral factor is

$\min(CF_{ETH}, CF_{USDT})$

, and its liquidation threshold is $\min(Liq\_thld_{ETH},Liq\_thld_{USDT})$

. The configuration of the LP token is defined on the next page.Last modified 8mo ago