I am using Node.js with Typescript.
Websites like RugCheck.xyz do this. We paste a token that tells us how much liquidity is locked for that particular token. I was told that it depends on how much of the LP was burned by the creator. How do I find that out? How do I find out how much LP was there in the first place and how much has been burned? If 100% is burned, does that mean the LP is 100% locked? I read somewhere that I should search for burn transactions and decode them. But how do I search for burn tons? Going through all items outputted from getSignaturesForAddress would be a very resource-intensive and time-consuming process. And if not, how would I exactly do that?
I'd also programmatically like to get the current price of a token. How would I do that? I don't want to use an existing API but rather do it with an SDK. I already have the following three SDKs installed in my project: @solana/web3.js, @solana/spl-token, @metaplex-foundation. I also installed the @raydium-io/raydium-sdk but haven't exactly been able to figure out much from it. I know that I can get information using the pool something class and .decode
method in it after I pass in .data
from getAccountInfo
. But I'm not sure if that gives me what I need. Also, it's giving me values in BigInt, I guess. I'm using Number()
to convert them to a number
but I don't know if that's the best approach, that's the one that worked with TS though.
Furthermore, if I were to create a system that identified all new pools created on, let's say, Raydium, how would I do that? I'm unsure what I should do after setting up a WebSocket subscription for onProgramChange for Raydium. And I'm not sure if that's the correct way to do it in the first place.