Streaming and Parsing Raydium CLMM Accounts
Real-Time Monitoring of Raydium CLMM Account States via Solana Yellowstone gRPC
Last updated
Was this helpful?
Real-Time Monitoring of Raydium CLMM Account States via Solana Yellowstone gRPC
Last updated
Was this helpful?
To gain a complete real-time understanding of Raydium's Concentrated Liquidity Market Maker (CLMM) pools, simply tracking transactions isn't enough. It's equally vital to monitor the dynamic state of the CLMM accounts themselves, which hold crucial information about liquidity positions, fees, and more. This document will guide you through streaming and parsing real-time account updates for Raydium CLMM, providing deep, live insights into these sophisticated liquidity structures.
The complete source code for this project is available on GitHub.
Please feel free to clone the repository and try it out. Additionally, you will find other relevant and useful code examples related to gRPC and streaming .
This project consists of two key components:
Streaming Raydium CLMM Accounts via Yellowstone gRPC
Decoding those accounts using the program's IDL
The first step involves initializing the Solana Yellowstone Client. You can get Solana Yellowstone gRPC access from the Shyft Dashboard. Please check out our for more details.
Once you have the authentication details, you can initialize the client in the following manner,
You can use any Yellowstone gRPC endpoint with this client. An access token is optional, as some gRPC services don't require authentication.
The Rust client supports several additional options, as demonstrated in the example above. Most of these options are also available for the TS client, where they are passed as the third argument to the Client
constructor.
To specify what on-chain data, we send a SubscribeRequest
over the existing Solana Yellowstone gRPC client. These Request allows you to filter for specific accounts, transactions, slots, or other Solana on-chain events, giving you full control over the data you receive.
For example, to stream Raydium accounts, you can set the owner
field to the Raydium CLMM program ID. This ensures that only accounts associated with the Raydium program are streamed in real-timeβideal for use cases like crypto trading bots, on-chain analytics, or DeFi dashboards requiring program-specific data.
When account data updates on-chain, it's immediately sent over the stream. To make sense of this raw information, we need to decode it. In JavaScript/TypeScript, we typically use BorshAccountCoder
from @coral-xyz/anchor
to parse the account data like this. But in cases where the IDL is not available, we define the account structure. This is one such case.
use filters to determine what type of on-chain data to stream. When streaming account-level data, the account filter plays a crucial role. Specifically, the owner
field within the filter allows you to stream data for accounts owned by a particular Solana program.
Once established, the stream will begin sending data directly to your application. You have the flexibility to on the fly, allowing you to change the data specifications you receive without stopping your stream. For more details on , or , you can find additional information in our .
On Rust however, we can use the Solores generated IDL like in our example.
β In-depth technical docs for implementing real-time streaming with Yellowstone gRPC and Geyser plugin on Solana.
β Guides, use cases, and performance benchmarks for building low-latency Solana applications using gRPC-based infrastructure.
β Ready-to-use code snippets and integrations for common DeFi protocols, transaction parsers, and real-time Solana data streaming use cases.