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 statearrow-up-right. Find the token ID here.
Check tokens.totalIssuance with the token ID as parameter.
tokens.totalIssuance
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.
xyk.liquidityPools
Then call xyk.pools with the params you just got as a result, you will get the number of tokens in the pool.
xyk.pools
Last updated 2 years ago