Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function for get LP token value #1

Open
ranamalo opened this issue Apr 18, 2021 · 2 comments
Open

Add function for get LP token value #1

ranamalo opened this issue Apr 18, 2021 · 2 comments

Comments

@ranamalo
Copy link

I think this would be a great addition to what you have already built here. Perhaps there is a way to calculate this from the 'pcsPairInfo'? I usually calculate it from manually looking at the contract and dividing the total LP value by the total token supply, so being able to look up a contract from address would work too. These contract addresses aren't available from "https://api.pancakeswap.info/api/tokens" as far as I know.

@gauss314
Copy link
Owner

gauss314 commented May 4, 2021

The total pool liquidity and the token prices are available, but the pancake API does not provide information on the amount of LP, maybe they will add this info now that they have updated to the V2 of their pools but it's not available yet

@ranamalo
Copy link
Author

ranamalo commented May 5, 2021

Are you referring to the "price" available from https://api.pancakeswap.info/api/v2/pairs? If so, that price appears to just be the quote_volume / base_volume and doesn't seem to give the value of the LP token, which would be what I described above.

There is also https://api.pancakeswap.info/api/v2/tokens/

that has a "price" but doesn't appear to work for LP contracts. At least the three I tried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants