Uniswap V3 LP Token Analyzer
Uniswap V3 LP token is an NFT token that represents the liquidity provision position. Check Uniswap V3 Whitepaper for detail.
Specifically, the variable
represents the liquidity given the relative price (
) of asset
in the denomination of asset
at the time the position is created/last changed, the lower bound (
) and upper bound (
) of price in which the user chooses to provide liquidity.
- 1.Define input parameters. On the page of adding liquidity in Uniswap V3, three factors have to be defined,,, and either one ofand, whereanddenote the number ofandtokens that will be injected into the liquidity provision position.
- 2.Calculateandor. Depending on which one ofandis defined in step 1), the other one will be calculated. The detailed calculation follows formula 2.2 on Uniswap V3 Whitepaper. For example, ifis defined, we will first solvebased on (1) and then calculatebased on (2) below:Note herein Uniswap V3.
- 3.Then given price fluctuating to any,andthat represent the number ofandtokens redeemable from the liquidity provision position can be derived following eq. 6.29 and 6.30 in Uniswap V3 Whitepaper, which are copied and pasted below:
To get
and
in a given position as well as other information, function
positions()
can be called. See details here.