# Solana gRPC Docs

A <mark style="color:yellow;">geyser plugin</mark> on Solana allows you to push real-time updates from a Solana RPC node to an external source. <mark style="color:yellow;">**Yellowstone gRPC**</mark> is one such high-performance Solana Geyser plugin that allows you to stream real-time blockchain data via gRPC interfaces. This powerful tool enables developers to:

* **Monitor on-chain activities:** Track token mints, program interactions, and state changes.
* **Stream account states:** Efficiently retrieve account information.
* **Stream transactions:** Monitor transactions with minimal latency.
* **Indexers:** Build indexing pipelines

In short, this can be used to build applications that can respond quickly to changes on the blockchain.

{% hint style="info" %}
Looking for the fastest way to pipe blockchain events into your stack? [<mark style="color:yellow;">Shyft's Yellowstone gRPC service</mark>](https://shyft.to/solana-yellowstone-grpc) is the most robust real-time data streaming solution on Solana, built for developers who need 100% data integrity at scale.
{% endhint %}

## Resources and Replits on Shyft gRPCs

We have developed multiple sample code covering top use cases for gRPC. They run out of the box, are in multiple languages (Typescript, Rust and python) and help you get started quickly. You can explore them here

* Shyft [<mark style="color:yellow;">GitHub</mark>](https://github.com/Shyft-to/solana-defi)
* Shyft [<mark style="color:yellow;">Replit</mark>](https://replit.com/@shyft-to)
* Shyft [<mark style="color:yellow;">Blogs</mark>](https://blogs.shyft.to/)

You can also join [<mark style="color:yellow;">Shyft's discord</mark>](https://discord.gg/8JyZCjRPmr) for support and more resources.&#x20;

{% hint style="warning" %}
Unlike regular RPCs calls which are used to interact with the Solana blockchain by sending HTTP POST requests, gRPCs are only used for streaming real-time updates on Solana with minimum latency.
{% endhint %}

## Authentication

There are two ways to authenticate your server or connection when connecting to Shyft’s gRPC network:

1. **Using X-Token:**

<figure><img src="https://2394289113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4XnSsBH76iytbI7NwX5o%2Fuploads%2F991ZTq6E1yd4Yxl9j1Cn%2FX-token-1.jpg?alt=media&#x26;token=de80b96b-3e75-44c4-b8c7-050ba84e97f5" alt=""><figcaption><p>x-token is available in the gRPC section of the dashboard</p></figcaption></figure>

After purchasing the gRPC service on Shyft, you can find your <mark style="color:yellow;">x-token</mark> in the gRPC section of your Shyft dashboard. This token is used to establish a gRPC connection through the Yellowstone client. The advantage of this method is that it doesn’t require IP whitelisting.

```javascript
const client = new Client(
  <YOUR-GRPC-ENDPOINT>,
  <YOUR-X-TOKEN>,
  undefined
); //initializing yellowstone client
```

2. **By Whitelisting Your IP:**

{% hint style="warning" %}
We recommend using token for authentication. Use IP whitelisting only when you cant use token authentication.
{% endhint %}

In certain scenarios, like when setting up bots, you may need to connect directly to the gRPC network via the <mark style="color:yellow;">gRPC URL without x-token</mark>. In such cases, you’ll need to <mark style="color:yellow;">whitelist</mark> your server’s IP address (the one used to receive streamed data). Once the IP is whitelisted, you can connect directly using the URL without needing an x-token. IP whitelisting can be easily managed through the gRPC section of the dashboard.

<figure><img src="https://2394289113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4XnSsBH76iytbI7NwX5o%2Fuploads%2F0E2qF5iWVQEjstWxAOnY%2FxToken-2-1.jpg?alt=media&#x26;token=ab85ced2-dfcc-43e8-bdf3-4c74593bfbfa" alt=""><figcaption><p>Whitelist your server IP to directly use without X-TOKEN</p></figcaption></figure>

{% hint style="info" %}
Please note, gRPC connections can be made from any IP address using *<mark style="color:yellow;">x-token</mark>*. Once an IP address is whitelisted, x-tokens are no longer required for connection from that IP.
{% endhint %}

## What are gRPC Subscribe Requests?&#x20;

Real-time updates in Solana’s Yellowstone gRPC plugins rely on <mark style="color:yellow;">Subscription streams</mark>. These streams let you receive updates like account changes, transactions, new blocks, or slot updates directly to your backend. To keep things focused and avoid unnecessary data, a <mark style="color:yellow;">subscription request</mark> lets you specify different kind of filters. using these filters you can specify exactly what type of updates you need.&#x20;

Subscribe requests on gRPC look somewhat like this.

```typescript
import { CommitmentLevel } from "@triton-one/yellowstone-grpc";

const req: SubscribeRequest = {
  accounts: {},
  slots: {},
  transactions: {},
  transactionsStatus: {},
  entry: {},
  blocks: {},
  blocksMeta: {},
  accountsDataSlice: [],
  ping: undefined,
  commitment: CommitmentLevel.CONFIRMED,
};
```

Most of the request parameters here are self-explanatory, working exactly with what they are named,

* <mark style="color:yellow;">`accounts`</mark>**:** You can subscribe to specific accounts (e.g., SOL-USDC OpenBook) by specifying this parameter and receive updates based on commitment levels (processed, confirmed, finalized).
* <mark style="color:yellow;">`accountDataSlice`</mark>: This field helps you to filter your gRPC stream, so that you receive only the relevant portion of streamed data. For example you are streaming accounts, for which the data size is 200bytes, but you only need 40 bytes after a certain offset. This field can help you filter those 40 bytes for every update in the stream.
* <mark style="color:yellow;">`transactions`</mark> & <mark style="color:yellow;">`transactionsStatus`</mark>: You can receive updates on all transactions or filter them based on specific criteria (vote/failed transactions, including/excluding accounts). Programs can also be monitored using this.
* <mark style="color:yellow;">`slots`</mark>, <mark style="color:yellow;">`blocks`</mark> & <mark style="color:yellow;">`blocksMeta`</mark> **:** Stay informed about new blocks and slots being produced on the blockchain.
* <mark style="color:yellow;">`commitment`</mark>: This specifies the commit level for any update, either `processed`, `confirmed` or `finalized`.

## FAQ <a href="#solana-grpc-faq" id="solana-grpc-faq"></a>

<details>

<summary>How is Solana gRPC different from Websockets?</summary>

WebSockets transmit JSON over HTTP and are easier to implement for quick integrations, while gRPC streams use Solana’s Geyser plugin system to push **real-time transactions, accounts**, and **blocks** with minimal overhead. This makes gRPC ideal for high-throughput performance applications like trading bots, market makers, and analytics platforms, whereas WebSockets are better suited for lighter, less latency-sensitive use cases.

</details>

<details>

<summary>How do I connect to a Yellowstone gRPC endpoint?</summary>

To connect to a Yellowstone gRPC endpoint, you need:

1. <mark style="color:yellow;">A gRPC endpoint URL</mark> – This is the address your client will connect to.
2. <mark style="color:yellow;">A Yellowstone-compatible gRPC client</mark> – Choose one in your preferred programming language (Rust, [Node.js](https://www.npmjs.com/package/@triton-one/yellowstone-grpc), etc.).&#x20;

For **Shyft Yellowstone gRPC**, you’ll also need an  `x-token` for authentication. The connection URL and `x-Token` are included in any gRPC-enabled Shyft plan.

Please refer to our connections and [authentication docs](#authentication) here.

</details>

<details>

<summary>What data can I stream using Solana gRPC?</summary>

With Solana gRPC, you can subscribe to:

* [**Transactions**](https://docs.shyft.to/solana-yellowstone-grpc/docs/transaction-streaming) – Detailed transaction data, including instructions, logs, and status.
* [**Accounts**](https://docs.shyft.to/solana-yellowstone-grpc/docs/account-streaming) – Live updates on account state changes.
* [**Blocks**](https://docs.shyft.to/solana-yellowstone-grpc/docs/streaming-blocks-and-blocksmeta) – Newly produced blocks with transaction metadata.

  These streams are ideal for bots, trading engines, real-time dashboards, and analytics platforms.

</details>

<details>

<summary>How do I parse raw Solana transaction data from Yellowstone gRPC?</summary>

Raw transaction data streamed from Solana Yellowstone gRPC is typically in a <mark style="color:yellow;">base64</mark> or binary-encoded format. To convert this into human-readable form, you can use the corresponding <mark style="color:yellow;">program’s IDL</mark> (Interface Definition Language) or a custom parser to decode the instructions, accounts, and logs.

Our developer documentation and GitHub examples cover step-by-step methods for:

* Decoding transactions using Anchor IDLs.
* Parsing data from popular Solana programs such as System Program, Token Program, and Associated Token Program.
* Extracting structured data from DEX trades, DeFi protocols, and custom programs.

Explore examples: Visit our [Docs](https://docs.shyft.to/solana-yellowstone-grpc/examples) and [GitHub repository](https://github.com/Shyft-to/solana-defi) for complete code samples on receiving and parsing Solana transactions via Yellowstone gRPC.

</details>

<details>

<summary>How far back can I stream slots from using gRPC?</summary>

Our service supports streaming from up to **150 slots** prior to the current head (maximum lookback depth is 150 slots).

Here is a [example for streaming from a specific slot](https://github.com/Shyft-to/solana-defi/tree/main/general-grpc-examples/Typescript/add_a_reconnect_mechanism) on Solana using gRPC.

</details>

<details>

<summary>Are there any rate limits for Solana Yellowstone gRPC streaming?</summary>

No Rate Limits. Shyft Yellowstone gRPC offers <mark style="color:yellow;">different subscription tiers</mark>, each with its own connections limits for streaming, but  <mark style="color:yellow;">no rate limits</mark> to the number of subscribe request you send. However,  certain high load programs, (such as the token program) is only allowed on Dedicated Nodes.

Check our [pricing and rate limit documentation](https://shyft.to/solana-rpc-grpc-pricing) to choose the plan that matches your Solana data streaming needs.

</details>

<details>

<summary>How are Dedicated gRPC Nodes better than Shared gRPC plans?</summary>

Solana Dedicated Nodes deliver a latency advantage of <mark style="color:yellow;">5–10ms</mark> over shared nodes, making them ideal for high-frequency trading, real-time analytics, and low-latency DeFi applications. Unlike shared nodes, they are <mark style="color:yellow;">exclusively allocated</mark> to you, with <mark style="color:yellow;">no rate limits</mark> and <mark style="color:yellow;">no access restrictions</mark> on high-load Solana addresses. Each dedicated node is <mark style="color:yellow;">load-balanced</mark> across a cluster of backup nodes, ensuring <mark style="color:yellow;">99.99%+ uptime</mark> and uninterrupted access to the Solana blockchain. [Learn More](https://shyft.to/solana-dedicated-grpc-nodes).&#x20;

</details>

<details>

<summary><strong>Why is lag building up over time with gRPC?</strong></summary>

If you notice that over time ag starts to build up, then there are two possible reasons.

* Your server is far away from the gRPC region you are connecting to. For example, if you are connecting to <mark style="color:yellow;">grpc.ams.shyft.to,</mark> your server should also be in the same region i.e Ams. We have seen cases where lag starts to build up over time if the server is far away. Its acceptable if ping < 10ms, although some users would want it to be less than 1ms.
* Another reason is that typescript sometimes is not able to keep up with gRPC speed. We suggest using <mark style="color:yellow;">Rust gRPC</mark> client for fastest processing. We have some sample codes in our [<mark style="color:red;">**Github repo**</mark>](https://github.com/Shyft-to/solana-defi) **and** [<mark style="color:red;">**Replit**</mark>](https://replit.com/@shyft-to/).
* Don't use VPNs.
* At anytime you can verify the current slot of all our regions [<mark style="color:red;">**here**</mark>](http://metrics-pool.shyft.to:3000/public-dashboards/23f6575360d9490e8fff3a82ae4f5a08?from=now-30m\&to=now\&timezone=browser)<mark style="color:red;">.</mark>

</details>

<details>

<summary>Why am I getting the following error message, “PermissionDenied, message: "Maximum connection count reached for IP address”?</summary>

This indicates you have the grpc rate limits for your plan, please checkout the details [here](https://shyft.to/solana-rpc-grpc-pricing).

</details>

<details>

<summary><strong>Why am I getting Maximum IP limit reached for token error?</strong></summary>

* This behavior is only observed on the **legacy gRPC plan**, which limits you to a single IP address. If you are on one of our newer plans — <mark style="color:$primary;">BUILD</mark>, <mark style="color:$primary;">GROW</mark>, or <mark style="color:$primary;">ACCELERATE</mark> — you can make connections from unlimited IP addresses, and this error will not occur.
* You can also get this when you change your server and the connection was not gracefully shutdown. In those cases you can clear your previous connection through this link [<mark style="color:red;">https://grpc.ams.shyft.to/clear-connections?xtoken=your-token</mark>](https://grpc.ams.shyft.to/clear-connections?xtoken=your-token)\
  Add your token in the end, grpc region doesnt matter.

</details>

<details>

<summary>How do I check if any gRPC region is lagging or not?</summary>

We have a public dashboard where you can see lag of all gRPC regions in our network. We compare it against Solana mainnet-beta. You can access it [<mark style="color:red;">**here**</mark>](http://metrics-pool.shyft.to:3000/public-dashboards/23f6575360d9490e8fff3a82ae4f5a08).

</details>
