raydium-io / raydium-sdk-V2

Open-source Typescript SDK for Raydium
GNU General Public License v3.0
87 stars 49 forks source link

Several functions under raydium.api seems not working? #36

Closed TechSkieur closed 2 months ago

TechSkieur commented 2 months ago

Sample Code:

    const raydium = await Raydium.load({
        owner: wallet,
        connection: new Connection("https://api.mainnet-beta.solana.com", "confirmed"),
        cluster: "mainnet",
        disableFeatureCheck: true,
        disableLoadToken: true,
        blockhashCommitment: "confirmed",
      });
    const props: FetchPoolParams = { type: PoolFetchType.All, sort: "apr24h", order: "desc", page: 0, pageSize: 50 };
    const data = await raydium.api.getPoolList(props);
    console.log(data);

Tried function getPoolList, getTokenInfo, fetchPoolByMints, all not working, return null or zero data, which is not right. But if using function getTokenList, then results can be returned. Not sure why is that and potentially where goes wrong? Tested also with devnet

cruzshia commented 2 months ago

api doesn't support devent

TechSkieur commented 2 months ago

@cruzshia thanks for checking. But in fact I tried with mainnet, check my code sample above, still not return desired results...could you explain a bit more?

cruzshia commented 2 months ago

page in FetchPoolParams should start from 1 not 0

TechSkieur commented 2 months ago

@cruzshia thanks! And one more question, if wanna retrieve Pool list for devnet, is there a way I can do that by calling some other methods or?

cruzshia commented 2 months ago

for api no, not supported. if you really want to get devent pool list, you can take a reference code here: https://github.com/raydium-io/raydium-sdk-V2-demo/blob/master/src/trade/routeSwap.ts#L41 by calling rpc. you should use a paid rpc to get those info cuz the data is really huge and just some basic info,

TechSkieur commented 2 months ago

@cruzshia thanks! You explained me everything I need!