Shyft
Start BuildingSupportWebsite
  • Welcome
    • 👋Introducing Shyft
    • 🏗️Start Building
  • Solana Infrastructure
    • 🚁Shyft RPCs
  • Yellowstone gRPC Network
    • Decoding gRPC Latency
    • ⚡gRPC Docs
      • Introduction
      • Authentication
      • Subscribe Requests
      • FAQ
      • Getting Started
        • Initializing the Yellowstone Client
        • Making a gRPC connection
        • Adding a Reconnection Mechanism
        • 🔥Replaying Slots with Solana yellowstone gRPCs
        • Modifying your Subscribe Request
        • Closing a gRPC Connection
      • Subscribing to Transactions
        • All Transactions of an address
        • Subscribing to all transactions of a Liquidity Pool
        • Subscribing to all transactions of multiple addresses
        • Subscribing to all transactions of a Token
      • Subscribing to Accounts
        • Account Updates for a Program
        • Account Updates for an Address
        • Account updates using memcmp
      • Streaming Blocks & BlocksMeta
        • Streaming Block Updates
        • Subscribing to BlocksMeta
      • Modifying & Unsubscribing
  • Solana defi data
    • DeFI APIs
      • Get Pool By Address
      • Get Pools By Token Pair
      • Get All Pools for a Token
      • Get Liquidity Details of a Pool
  • Callbacks
    • ☎️What are Callbacks?
      • Transaction Callbacks
      • Account Callbacks
    • 📔Callback APIs
      • Response Structure
      • List Callbacks
      • Register callback
      • Remove callback
      • 🔥Pause a callback
      • 🔥Resume a callback
      • Update Callbacks
      • Add Addresses
      • Remove addresses
  • Solana Super Indexers
    • 🌩️GraphQL APIs
      • Getting Started
      • Building Queries
      • Paginating Response
      • Applying Filters
      • Ordering and Sorting Data
    • 📀Case Studies
      • Tensor
        • Get Active Listings of a Wallet
        • Get Active Bids of a Wallet
        • Get Active Listings of a Collection
        • Get all Bids of a Collection
        • Get all Pools of a Margin Account
        • Get all Pools by Owner
      • Raydium
        • Get Pool By Address
        • Get Pools By Token Address
        • Get Pools Created Between Time
        • Get Pool Burn Percentage
        • Get Liquidity Details of a Pool
        • Get Pool and OpenBook Market Info
        • Get Token Supply Percentage In Pool
      • Orca Whirlpool
        • Get Pool by Address
        • Get Pool by Token Address
        • Get Positions for a Pool
        • Get Positions for a Wallet
        • Get Liquidity Details of a Pool
      • Kamino
        • Get Borrow Details of a Wallet
        • Get Deposit Details of a Wallet
        • Get Reserve Details
      • Cross Marketplace Queries
        • Get active listings across marketplaces for a wallet
        • Get listings for a collection across marketplaces
        • Get floor price of a collection
      • Cross Defi Queries
        • Fetch Liquidity Pools for Token
      • Native Staking
        • Get Stakes for a Wallet
        • Get Stakes For Validator
      • Governance/Realms
        • Get DAO Token Owners
        • Get Proposals For Governing Mint
        • Get All Proposals For DAO
        • Get DAO Treasury Info
        • Get All Active Proposals For Wallet
      • Meteora
        • Get All LB Position Pairs
        • Get Position of a User Wallet
        • Get Pool by Token Addresses
        • Get All Deposits for a User
        • Get All Withdraws for a User
        • Get All Fees Claimed by a User
        • Get All User Positions and Deposits for a Pool
        • Get All User Positions and Withdrawals for a Pool
      • Fluxbeam
        • Get Pool by Address
        • Get Pool by Token Addresses
      • Drift
        • Get User account for Delegate
        • Get User accounts based on authority
        • Get User details based on Referrer
        • Get Borrow/Deposit Amount for an User
        • Get PrepPositions for an User Account
        • Getting OrderId and userOrderId
        • Get OpenOrders for a User Account
      • 🔥Pumpswap
        • 🔥Get Pool by Address
        • 🔥Get Pool by Creator Address
        • 🔥Get Pools by Token Addresses
      • Raydium Launchpad
        • Get Bonding Curve Details by Pool Address
        • Get All Pools for a Creator
        • Get Pools by Token Addresses
        • Get Migration details of a Pool
  • Solana APIs
    • API Reference
    • Transactions
      • Parsed Transaction Structure
      • Transaction APIs
        • History
        • Parse Signature
        • Parse Multiple Signatures
        • Send
        • Send Multiple
    • NFT
      • 🔥Create Gasless
      • Create
      • Read All
      • Burn
      • 🔥Burn Multiple NFTs V2
      • Update
      • 🔥Create NFT from Metadata
      • 🔥Read Wallet Nfts
      • 🔥Read Selected NFTs
      • 🔥Get NFT Owners
      • 🔥Update NFT Metadata Uri
      • 🔥Update V2
      • Search
      • Transfer
      • Transfer Multiple NFTs
      • Mint
      • Read
    • Wallet
      • Get Balance
      • Get Token Balance
      • Get All Tokens Balance
      • Get Portfolio
      • Resolve Address
      • Get All Domains
      • Get Stake Accounts
    • Fungible Tokens
      • Create
      • Mint
      • Burn
      • 🔥Update
      • Get Token Info
      • Transfer
      • Airdrop
Powered by GitBook
On this page
  • Resources and Replits on Shyft gRPCs
  • Authentication
  • What are Subscribe Requests?
  • FAQ

Was this helpful?

  1. Yellowstone gRPC Network

gRPC Docs

gRPC 101 for streaming low-latency Solana updates.

PreviousDecoding gRPC LatencyNextGetting Started

Last updated 3 months ago

Was this helpful?

A geyser plugin on Solana allows you to push real-time updates from a Solana RPC node to an external source. Yellowstone gRPC 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.

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

  • Shyft

  • Shyft

You can also join for support and more resources.

Unlike regular RPCs 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.

Authentication

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

  1. Using X-Token:

After purchasing the gRPC service on Shyft, you can find your x-token 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.

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

  1. By Whitelisting Your IP:

We recommend using token for authentication. Use IP whitelisting only when you cant use token authentication.

In certain scenarios, like when setting up bots, you may need to connect directly to the gRPC network via the gRPC URL without x-token. In such cases, you’ll need to whitelist 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.

Please note, gRPC connections can be made from any IP address using x-token. Once an IP address is whitelisted, x-tokens are no longer required for connection from that IP.

What are Subscribe Requests?

Real-time updates in Solana’s Yellowstone gRPC plugins rely on Subscription streams. 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 subscription request lets you specify different kind of filters. using these filters you can specify exactly what type of updates you need.

Subscribe requests on gRPC look somewhat like this.

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,

  • accounts: 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).

  • accountDataSlice: 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.

  • transactions & transactionsStatus: 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.

  • slots, blocks & blocksMeta : Stay informed about new blocks and slots being produced on the blockchain.

  • commitment: This specifies the commit level for any update, either processed, confirmed or finalized.

FAQ

Why is lag building up over time with gRPC?

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 grpc.ams.shyft.to, 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.

  • Don't use VPNs.

Why am I getting Maximum IP limit reached for token error?
  • Base $199/mo subscription gives you access to connect from one IP. If you connect from multiple IPs, you will get this error.

How do I check if any gRPC region is lagging or not?

Another reason is that typescript sometimes is not able to keep up with gRPC speed. We suggest using Rust gRPC client for fastest processing. We have some sample codes in our and .

At anytime you can verify the current slot of all our regions .

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 Add your token in the end, grpc region doesnt matter.

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 .

⚡
GitHub
Replit
Blogs
Shyft's discord
Github repo
Replit
here
https://grpc.ams.shyft.to/clear-connections?xtoken=your-token
here
x-token is available in the gRPC section of the dashboard
Whitelist your server IP to directly use without X-TOKEN