What is an LP token ?
An LP token (Liquidity providing token) is a token received in exchange for the liquidity provided to a liquidity pool, in proportion to the total liquidity of the pool. The instantaneous value of an LP token is equal to the division of the total value of the assets contained in the pool at time T by the total quantity of LP tokens at that time.
The value of this LP token can vary in different ways, notably :
Via the fees generated by the exchanges made using the liquidit made available by this pool.
The loss/gain in value of assets making up the pool (impermanent loss).
This token also allows liquidity to be withdrawn in proportion to the value of the LP token at the time of withdrawal.
Paul decides to deposit 500 USDT and 500 USDC into a liquidity pool containing 49,500 USDT and 49,500 USDC. At that time, 1 USDT = 1$ et 1 USDC = 1$. In proportion to his deposit in the pool, he receives 1000 LP tokens in exchange.
A few weeks later, users use the liquidity pool to trade, which generates fees that are added to the liquidity pool as a compensation.
Paul decides to withdraw his liquidity. At this time, the pool consists of 50,200 and 49,900 USDC which represent 100,000 LP tokens distributed among the different liquidity providers in proportion to the share of the total liquidity they have contributed.
At this time, 1 USDT = $0.997 and 1 USDC = $1.003.
Paul's 1,000 LP tokens therefore represent 502 USDT and 499 USDC, for a value at this moment of $1,001.