Skip to main content

Quick Setup

Get streaming Solana data in minutes with working code examples. Choose your approach based on your needs:
MethodBest ForPlan RequiredLatency
Shred DeliverypropAMMs, snipers, copy traders, liquidation bots, arbitrage — pre-execution dataAll plans (paid add-on)Earliest possible
LaserStream gRPCMission-critical, backend servicesAll plans (Devnet), Business+ (Mainnet)Fastest
LaserStream WebSocketMost apps, real-time UIs, broad compatibility.Free+ (Helius extensions: Developer+)Fast
WebhooksServer notifications, event-driven appsFree+Variable
Need raw shreds? Subscribe from the Shreds tab in your Helius Dashboard. See How to Subscribe to Raw Shreds for setup steps.

Option 1: LaserStream gRPC

Most reliable option with 24-hour historical replay and multi-node failover. Best for mission-critical backends and indexers.
npm install helius-laserstream
import {
  subscribe,
  CommitmentLevel,
  LaserstreamConfig,
  SubscribeRequest,
} from "helius-laserstream";

async function main() {
  const subscriptionRequest: SubscribeRequest = {
    transactions: {
      "token-filter": {
        // user-defined label for this filter
        accountInclude: ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],
        accountExclude: [],
        accountRequired: [],
        vote: false,
        failed: false,
      },
    },
    commitment: CommitmentLevel.CONFIRMED,
    accounts: {},
    slots: {},
    transactionsStatus: {},
    blocks: {},
    blocksMeta: {},
    entry: {},
    accountsDataSlice: [],
  };

  const config: LaserstreamConfig = {
    apiKey: "YOUR_API_KEY",
    endpoint: "https://laserstream-mainnet-ewr.helius-rpc.com",
  };

  await subscribe(
    config,
    subscriptionRequest,
    async (data) => {
      console.log(data);
    },
    async (error) => {
      console.error(error);
    },
  );
}

main().catch(console.error);

LaserStream Guide

Complete LaserStream documentation with historical replay

Get started

Get your LaserStream gRPC token and endpoint in your Helius dashboard

Option 2: LaserStream WebSocket

LaserStream WebSocket serves the standard Solana subscription methods and Helius extensions like transactionSubscribe on a single unified endpoint. Perfect for browser/UI clients and broad ecosystem compatibility.
const WebSocket = require("ws");

const ws = new WebSocket("wss://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY");

ws.on("open", () => {
  console.log("WebSocket connected");

  // Helius extension: transactionSubscribe with rich filtering
  ws.send(
    JSON.stringify({
      jsonrpc: "2.0",
      id: 1,
      method: "transactionSubscribe",
      params: [
        {
          accountInclude: ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],
          vote: false,
          failed: false,
        },
        {
          commitment: "confirmed",
          encoding: "jsonParsed",
          transactionDetails: "full",
        },
      ],
    }),
  );

  // Keep connection alive
  setInterval(() => ws.ping(), 30000);
});

ws.on("message", (data) => {
  const message = JSON.parse(data);
  console.log("Transaction:", message);
});
Replace YOUR_API_KEY with your key from dashboard.helius.dev.

LaserStream WebSocket Overview

All subscription methods (standard Solana + Helius extensions) with parameter reference and examples

Option 3: Webhooks

For server-side applications that need event notifications without holding a persistent connection.
# Create a webhook
curl -X POST "https://mainnet.helius-rpc.com/v0/webhooks" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "webhookURL": "https://your-server.com/webhook",
    "transactionTypes": ["Any"],
    "accountAddresses": ["YOUR_ACCOUNT_ADDRESS"],
    "webhookType": "enhanced"
  }'
// Handle webhook events (Express.js example)
app.post("/webhook", (req, res) => {
  req.body.forEach((event) => {
    console.log("Blockchain event:", event);
  });
  res.status(200).send("OK");
});

Webhooks Guide

Complete webhook setup and event handling

Common Use Cases

Monitor Token Transfers
// Subscribe to Token Program activity
method: "programSubscribe",
params: ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", {...}]
Track Pump.fun trades
// Subscribe to Pump.fun program transactions
method: "transactionSubscribe",
params: [
  {
    accountInclude: ["6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"],
    vote: false,
    failed: false
  },
  { commitment: "confirmed" }
]
Watch Wallet Activity
// Monitor specific wallet
method: "accountSubscribe",
params: ["WALLET_ADDRESS", {...}]

Next Steps

Streaming Overview

Learn about all streaming options and when to use each

API Reference

Complete method documentation and parameters
Need help? Join our Discord or check support docs.