chainstacklabs / raydium-sdk-swap-example-typescript

An example to swap tokens on Solana using the Raydium SDK, TypeScript, and Chainstack
MIT License
99 stars 35 forks source link

The liquidityFile is too large. Is there a faster way to get the poolInfo from two tokens? #14

Closed y0unghe closed 1 month ago

y0unghe commented 2 months ago

Whenever the swap executes the program will call the following codes to get the poolInfo to load the liquidity file. The file is 467MB. Is there a better and faster way to get the poolInfo?

await raydiumSwap.loadPoolKeys(Raydium_Liquidity_File);

let poolInfo = raydiumSwap.findPoolInfoForTokens(sourceToken, destinationToken);
mukul013 commented 1 month ago

You are right , did you find any other way to find be poolInfo faster ?

akegaviar commented 1 month ago

Hey guys, a valid point. I updated the project to only use the trimmed version. Check the TLDR quick run section as it has the details https://github.com/chainstacklabs/raydium-sdk-swap-example-typescript/blob/main/README.md#tldr-quick-run