I would like to be able to detect within 1-500 milliseconds of a price change on raydium for a select group of coins which I specify. I read the documentation for raydium api at https://docs.raydium.io/raydium/protocol/developers/apis , but they clearly state that this API is not suited for real time monitoring of data. What should be the approach here to get the required data within the required timeframe?
2 Answers
I'd recommend you subscribe to on-chain program events websocket via a rpc so you can stream it almost real time.
-
I am looking through the Solana rpc docs solana.com/docs/rpc but can't find a relevant rpc method to detect price changes of coins. Can you please link a suitable website from where I can continue my research? Thanks. Commented Mar 28 at 8:43
You can try Bitquery's Solana stream.
Here is an example of getting the price of currency
https://ide.bitquery.io/Live-price-of-a-token-on-Solana-blockchain
Here, we get the price of a token in real time.
To learn more check our docs - https://docs.bitquery.io/docs/category/solana/