> ## Documentation Index
> Fetch the complete documentation index at: https://docs.solanatracker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream Solana Transactions with gRPC

> Filter Yellowstone gRPC transactions by account or program, inspect execution metadata, and distinguish failed transactions from successful ones.

Filter executed transactions by the accounts they reference. Use the execution metadata for fees, logs, errors, and token balances; decode instructions or events for program-specific trade details.

Save the [quickstart helper](https://docs.solanatracker.io/yellowstone-grpc/quickstart.md) as `stream.mts` in the same directory. These examples use the same environment variables and dependencies.

## Subscribe by program or account

```typescript transactions.mts theme={null}
import bs58 from "bs58";
import { subscribe } from "./stream.mts";

const address = process.env.WATCH_ADDRESS;
if (!address) throw new Error("Set WATCH_ADDRESS to a program or account");

for await (const update of subscribe({
  transactions: {
    selected: {
      vote: false, failed: false,
      accountInclude: [address], accountExclude: [], accountRequired: [],
    },
  },
})) {
  const transaction = update.transaction?.transaction;
  if (!transaction) continue;
  console.log({
    signature: bs58.encode(transaction.signature),
    slot: update.transaction!.slot,
    feeLamports: transaction.meta?.fee,
    error: transaction.meta?.err,
    logs: transaction.meta?.logMessages,
  });
}
```

```bash theme={null}
export WATCH_ADDRESS="YOUR_PROGRAM_OR_ACCOUNT_ADDRESS"
npx tsx transactions.mts
```

## Combine transaction filters

* `accountInclude`: match at least one listed account.
* `accountRequired`: require every listed account.
* `accountExclude`: reject transactions that reference any listed account.
* `vote: false`: exclude validator votes.
* `failed: false`: successful executions only. Use `true` for failures, or omit it for both.
* `signature`: select one transaction signature.

The include, required, and exclude conditions work together. An empty include list does not restrict the set by itself.

## Interpret the result

The signature is binary; convert it with base58. The slot is on `update.transaction`, while execution details are on `update.transaction.transaction.meta`. A balance difference can include fees, rent, or several instructions, so it is not automatically a transfer amount.

## Track duplicates and gaps

For confirmed or finalized transaction indexing, use the signature as a deduplication key. If you consume processed updates, retain slot/fork context so later confirmation can reconcile provisional results. A reconnect does not by itself recover missed history.

## Related guides

> [card] [Pump.fun trades](https://docs.solanatracker.io/yellowstone-grpc/examples/pumpfun-transactions.md)

> [card] [Reliability and performance](https://docs.solanatracker.io/yellowstone-grpc/best-practices.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.