raydium-io / raydium-sdk-V1-demo

119 stars 55 forks source link

Why swapRoute.ts soooooo slow? #5

Open kevgithub opened 9 months ago

kevgithub commented 9 months ago

When I run swapRoute.ts in nodejs, it might cost 2 minutes, and I check the code, most time spent at those code:

const sPool: ApiPoolInfo = await formatAmmKeysToApi(PROGRAMIDS.AmmV4.toString(), true)

any suggestion?

also I get this error sometimes:

Error: 500 Internal Server Error: {"jsonrpc":"2.0","id":"7b40fc89-75f4-482f-8e78-8a5cd8cb6797","error":{"code":-32603,"message":"Internal server error"}}

I use the alchemy RPC node:

const RPC_MAINET = 'https://solana-mainnet.g.alchemy.com/v2/UZlhPRTS....';