# How to check the value of an LP token

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](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-archive.mangata.online#/chainstate). Find the token ID [here](https://docs.mangata.finance/welcome/guides/technical-guides/how-to-look-up-token-ids).

### Find the number of total LP tokens

Check `tokens.totalIssuance` with the token ID as parameter.

<figure><img src="https://3624648318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLbqvmGewRWFC8kc3j3Y5%2Fuploads%2F6VzRwmexmckIqNLRooPT%2Fimage.png?alt=media&#x26;token=db334f4f-3a31-4349-b3ba-7a02dd64d575" alt=""><figcaption></figcaption></figure>

### Find the number of tokens in the liquidity pool

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.

<figure><img src="https://3624648318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLbqvmGewRWFC8kc3j3Y5%2Fuploads%2F3k6UObarcHGtcYOZndfx%2Fimage.png?alt=media&#x26;token=8f9775e8-4c61-45f4-911f-abb821f971ed" alt=""><figcaption></figcaption></figure>

Then call `xyk.pools` with the params you just got as a result, you will get the number of tokens in the pool.

<figure><img src="https://3624648318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLbqvmGewRWFC8kc3j3Y5%2Fuploads%2FTKfyeAMbsv5R9sjghbWj%2Fimage.png?alt=media&#x26;token=d8a1fc58-cb31-4759-8448-178ae457d60c" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mangata.finance/welcome/guides/technical-guides/how-to-check-the-value-of-an-lp-token.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
