๐How to check the value of an LP token
Last updated
Last updated
To calculate the value of an LP token, we will find the total number of LP tokens and the number of tokens in the associated liquidity pool.
Open the developer portal to see the chain state. Find the token ID here.
Check tokens.totalIssuance
with the token ID as parameter.
Get the token IDs of the token in the pool (the order is important) with xyk.liquidityPools
and the LP token ID in the param.
Then call xyk.pools
with the params you just got as a result, you will get the number of tokens in the pool.