Set Up Yellowstone gRPC for Low-Latency Solana Streams
Connect to Yellowstone gRPC and stream Solana account, transaction and slot updates from dedicated infrastructure.
Yellowstone gRPC gives you validator-level streams
Yellowstone gRPC (a Geyser plugin) streams account updates, transactions and slots directly from the validator with lower latency than regular RPC polling or WebSocket. For latency-sensitive bots this is the fastest way to detect on-chain events. The setup is small: install the client, connect to your endpoint, then subscribe with explicit filters so the stream only sends data your app can use.
What you need
- Node.js 18+
- A gRPC endpoint + token (available on dedicated nodes / Yellowstone gRPC)
Step 1: Install the client
npm install @triton-one/yellowstone-grpc
Step 2: Connect
import Client, { CommitmentLevel } from '@triton-one/yellowstone-grpc';
const client = new Client(process.env.YELLOWSTONE_GRPC_ENDPOINT!, process.env.YELLOWSTONE_GRPC_TOKEN!, undefined);
await client.connect();
const version = await client.getVersion();
console.log('Connected:', version);
Step 3: Subscribe to a program's transactions
For example the Pump.fun program, to see every interaction:
const stream = await client.subscribe();
stream.on('data', (data) => {
if (data.transaction) {
console.log('Tx:', data.transaction.transaction.signature);
}
});
stream.write({
transactions: {
pumpfun: {
accountInclude: ['6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P'],
accountExclude: [],
accountRequired: [],
failed: false,
vote: false,
},
},
commitment: 'processed',
accounts: {},
slots: {},
blocks: {},
blocksMeta: {},
entry: {},
accountsDataSlice: [],
transactionsStatus: {},
});
Step 4: Subscribe to account updates
stream.write({
accounts: {
myAccounts: { account: [TARGET_ACCOUNT], owner: [], filters: [] },
},
commitment: 'processed',
transactions: {},
slots: {},
blocks: {},
blocksMeta: {},
entry: {},
accountsDataSlice: [],
transactionsStatus: {},
});
Step 5: Keep the stream healthy
stream.on('error', (e) => { console.error(e); /* reconnect logic */ });
stream.on('end', () => { /* reconnect */ });
FAQ
What's the difference between Yellowstone gRPC and WebSocket?
gRPC streams at Geyser level directly from the validator with lower latency and higher throughput; WebSocket RPC sits a layer above. For detection-critical bots gRPC is faster.
When do I need gRPC?
For HFT, MEV and arbitrage where you must see events before the competition. For dashboards and most apps a data API or WebSocket is enough.
Does this work on a shared node?
gRPC/Geyser belongs to dedicated infrastructure; see Solana Dedicated Nodes.
Related: Reduce Solana RPC latency ->
Download the example
Clone the full runnable project on GitHub, npm install && npm start with your keys in .env. See the tutorial for step-by-step context.
Runnable Node.js project — clone from GitHub, add keys to .env, then npm start. gRPC examples use native dependencies — run locally with Node.js.