How to Stream and Parse PumpSwap Transactions on Solana

·

Real-time data is essential for tracking dynamic markets on Solana, especially within decentralized exchanges (DEXs). As Pump.fun tokens transition from platforms like Raydium to the new Pump AMM, monitoring on-chain activity requires a fast, reliable, and low-latency solution. This is where gRPC streaming comes into play—offering developers a high-performance method to receive instant blockchain updates.

In this guide, we’ll walk through how to stream and parse PumpSwap AMM transactions using Solana’s gRPC protocol via Shyft’s infrastructure. Whether you're building analytics dashboards, trading bots, or real-time alert systems, mastering gRPC streaming unlocks powerful capabilities for interacting with Solana’s evolving DeFi ecosystem.


Prerequisites for Streaming Solana Transactions

Before diving into code, ensure you have the following setup:

💡 Tip: This tutorial uses TypeScript with Node.js, but the concepts apply universally across backend languages.

Understanding gRPC and Real-Time Data on Solana

Shyft’s gRPC service leverages the Yellowstone gRPC plugin, enabling real-time streaming of Solana chain data—including account changes, transactions, blocks, and slot updates. By subscribing to specific events, you can filter noise and focus only on relevant activity.

For PumpSwap, our goal is to capture every transaction interacting with its AMM program in real time and decode it into human-readable actions—such as buys, sells, and liquidity additions.

👉 Discover how real-time blockchain streaming powers next-gen DeFi apps.


Step 1: Initialize the Yellowstone gRPC Client

To begin receiving data, instantiate the gRPC client using your credentials:

import { Client } from '@shyft-to/yellowstone-grpc';

const client = new Client(
  'YOUR_REGION_SPECIFIC_GRPC_ENDPOINT',
  'YOUR_GRPC_ACCESS_TOKEN'
);

Once initialized, the client establishes a persistent connection to the Solana network via Shyft’s infrastructure, ready to accept subscription requests.


Step 2: Define Your Subscription Request

Use a SubscribeRequest object to specify exactly which data you want streamed. To monitor PumpSwap AMM activity, focus on transactions involving its program ID.

import { SubscribeRequest, CommitmentLevel } from '@shyft-to/yellowstone-grpc';
import { PUMPSWAP_AMM } from './constants'; // Program ID

const req: SubscribeRequest = {
  transactions: {
    pumpFun: {
      vote: false,
      failed: false,
      signature: undefined,
      accountInclude: [PUMPSWAP_AMM.toBase58()],
      accountExclude: [],
      accountRequired: [],
    },
  },
  commitment: CommitmentLevel.PROCESSED,
};

Key parameters:

Now, send this request over the stream:

async function handleStream(client: Client, args: SubscribeRequest) {
  const stream = await client.subscribe();

  stream.on("error", (err) => console.error("Stream error:", err));
  stream.on("end", () => console.log("Stream ended"));
  stream.on("close", () => console.log("Stream closed"));

  stream.on("data", (data) => {
    console.log("Raw transaction data:", data);
  });

  await new Promise<void>((resolve, reject) => {
    stream.write(args, (err) => {
      if (err) reject(err);
      else resolve();
    });
  });

  return stream;
}

This sets up a continuous flow of raw transaction data from the blockchain.


Step 3: Format and Decode Transactions

Raw gRPC responses include enriched metadata beyond standard RPC—like slot info, versioning flags, and message headers. Use Shyft’s TransactionFormatter to normalize them into familiar RPC-style objects.

import { TransactionFormatter } from './utils/transaction-formatter';

const TXN_FORMATTER = new TransactionFormatter();

const rpcLikeTx = TXN_FORMATTER.formTransactionFromJson(
  data.transaction,
  Date.now()
);

Next, parse the transaction instructions to extract meaningful actions (e.g., “Buy 10 SOL worth of token”).

Install the parser:

npm install @shyft-to/solana-transaction-parser

Initialize with PumpSwap’s IDL (Interface Definition Language):

import { SolanaParser } from '@shyft-to/solana-transaction-parser';
import { PublicKey } from '@solana/web3.js';
import pumpFunAmmIdl from './pump-fun-amm-idl.json';

const PUMP_FUN_AMM_PROGRAM_ID = new PublicKey(
  "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
);

const PUMP_FUN_IX_PARSER = new SolanaParser([]);
PUMP_FUN_IX_PARSER.addParserFromIdl(
  PUMP_FUN_AMM_PROGRAM_ID.toBase58(),
  pumpFunAmmIdl as Idl
);

Parse incoming transactions:

const parsedInstructions = PUMP_FUN_IX_PARSER.parseTransactionData(
  tx.transaction.message,
  tx.meta.loadedAddresses
);

console.log("Parsed Instructions:", parsedInstructions);

The output will include structured details such as:

This transforms opaque binary data into actionable insights.


Frequently Asked Questions (FAQ)

What is PumpSwap AMM?

PumpSwap is the automated market maker (AMM) platform where tokens originally launched on Pump.fun now trade post-migration. It enables decentralized trading without order books, using liquidity pools.

Why use gRPC instead of standard RPC?

gRPC supports bidirectional streaming, allowing real-time push updates from the node. Standard RPC relies on polling, which introduces delays and inefficiencies at scale.

Is Shyft the only provider for Solana gRPC?

While other providers exist, Shyft offers developer-friendly tooling, global node distribution, and built-in utilities like transaction parsing—making it ideal for DeFi monitoring.

Can I filter by specific tokens or wallets?

Yes. Extend the accountInclude array with token mints or user wallets. You can also post-process parsed data to trigger alerts based on custom logic.

How much latency should I expect?

With PROCESSED commitment, transactions typically arrive within 100–500ms of being included in a block—ideal for reactive applications.

Do I need to run my own validator?

No. Shyft manages full nodes and exposes their gRPC interfaces securely. This lowers entry barriers for developers building real-time dApps.


Practical Use Cases

Parsed PumpSwap data enables several powerful applications:

👉 See how top developers leverage real-time blockchain data for edge in DeFi.


Final Thoughts

Streaming and parsing PumpSwap transactions via gRPC gives developers unparalleled visibility into one of Solana’s most active DeFi ecosystems. By combining Shyft’s robust infrastructure with structured transaction decoding, you can build responsive, intelligent applications that thrive in fast-moving markets.

As more projects adopt real-time data pipelines, mastering gRPC becomes not just advantageous—but essential.


Resources

👉 Start building real-time Solana apps today—unlock live data streams with powerful tools.


Core Keywords:
Solana, PumpSwap, gRPC streaming, transaction parsing, real-time blockchain data, DeFi monitoring, AMM transactions, Shyft API