2

I’m building a Solana copy trading bot and I’m running into a performance bottleneck. Right now, I subscribe to the target wallet via WebSocket, and once I get a transaction signature I call the Helius getTransaction RPC. The problem is that for some swaps the response can take up to 20 seconds.

Is there any way to reduce this latency or improve the speed?

3 Answers 3

2

I suggest just going with Geyser for best latency, eg with Chainstack.

1
  • Do I need Rust programming and private node for Geyser? Commented Sep 3 at 13:17
0

Rather than subscribing to transactions in the manner you are now which is a multi - step process of transaction notification, then fetching TX details which may be irrelevant to your need, you can use helius webhook to subscribe to notifications for certain types of transactions like swaps https://www.helius.dev/docs/enhanced-websockets/transaction-subscribe

This returns parsed details of the transaction in webhook request so you never need to fetch any other details. It is also much faster in terms of notifications . Standard RPC methods usually arent used for things like copy trading and snipers for the reason you have pointed out (slow).

3
  • I’m already listening to the target wallet, so by the time I detect it the transaction has gone through. I just need to fetch the transaction details as quickly as possible. Now i do it using getSignature RPC Commented Aug 26 at 8:37
  • OH - i misunderstood the question. There is a MUCH better way to do this . Ill edit my answer Commented Aug 26 at 17:31
  • Now I am getting transaction data in about 1-1.5 s after tx added to chain. Much better , but still not enough. Is there cheaper way than helius 500 usd/month solution? I need to very fast websocket and very fast swap for that Commented Aug 27 at 18:12
0

I feel your pain. I've got a similar type setup for my personal trading bot using helius free and im thinking of upgrading to the $40 something plan to see if i get better websocket speeds,

  • Listen to websocket for a specific channel
  • Filter websocket data for specific information
  • Request getSignaturesForAddress ,so i can analyse transactions

My speed for the last point has been less than a second but I have had a few instances where it has felt like it hung on something for a moment longer or two.

I do wish the websocket was able to provide me faster upto date information... alot of what I get is atleast 15 to 20 seconds old...

2
  • Yes, now with free helius api I can make copy trade in 2 seconds at best. Swap takes around 0.6 and Websocket event about 1 second. Need faster WS and/or swap. Did you achieve any better results? Commented Sep 1 at 11:27
  • Hey, ive recently moved over to quicknode from free helius api. Alot better Websocket Speed and faster getSignatures and getTransactions. Im running a Java Build for my trading bot and I was running into simulation failures when I changed RPC but I found that passing skipPreflight = True made this run nicely. Commented Sep 2 at 12:12

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.