Subscribe to Transactions
Subscribe to Transactions
Transaction subscriptions allow you to monitor Solana transactions in real-time. This is crucial for DEX integrations, wallet monitoring, program event tracking, and transaction-based analytics.
Overview
Transaction subscriptions provide real-time updates for transactions matching your filter criteria. You can filter by:
- Transactions involving specific accounts
- Transactions calling specific programs
- Vote vs non-vote transactions
- Failed vs successful transactions
- Complex account inclusion/exclusion rules
Filter Structure
Filter Options
Vote Transactions
Control whether to include vote transactions (validator voting).
Field: vote
Type: optional bool
Values:
true
- Only vote transactionsfalse
- Only non-vote transactionsnull
(unset) - Both vote and non-vote transactions
Use Cases:
- Set to
false
for most application use cases (excludes validator voting spam) - Set to
true
only for validator monitoring or consensus analytics
Failed Transactions
Control whether to include failed transactions.
Field: failed
Type: optional bool
Values:
true
- Only failed transactionsfalse
- Only successful transactionsnull
(unset) - Both successful and failed transactions
Use Cases:
- Set to
false
to monitor only successful transactions - Set to
true
to analyze failure patterns - Leave unset to see all transaction attempts
Signature Filter
Filter for a specific transaction signature.
Field: signature
Type: optional string
Use Cases:
- Track a specific transaction through confirmation stages
- Monitor a transaction you just submitted
- Verify transaction inclusion
Note: This filter is rarely used in streaming contexts because you must know the transaction signature ahead of time.
If you want to track the confirmation status of a transaction you are about to send (for example, a payment or program interaction), you can set up a subscription for the expected signature before submitting the transaction. This way, you will receive real-time updates as soon as the transaction is processed by the network.
Account Include
Receive transactions involving any of these accounts.
Field: account_include
Type: repeated string
Behavior: Transaction matches if it involves any of the specified accounts.
Use Cases:
- Monitor a user’s wallet for any activity
- Track transactions for a set of token accounts
- Watch multiple DEX programs
Account Exclude
Exclude transactions involving these accounts.
Field: account_exclude
Type: repeated string
Behavior: Transaction is excluded if it involves any of these accounts.
Use Cases:
- Exclude noise from specific accounts
- Filter out unwanted program interactions
- Remove specific token account activity
Account Required
Require all of these accounts to be present.
Field: account_required
Type: repeated string
Behavior: Transaction matches only if it involves all specified accounts.
Use Cases:
- Match specific program interactions (program + user account)
- Find transactions involving multiple specific accounts
- Narrow down to very specific transaction patterns
Combining Account Filters
Account filters work together:
- Transaction must include at least one
account_include
(if specified) - Transaction must not include any
account_exclude
(if specified) - Transaction must include all
account_required
(if specified)
Example Logic:
Response Structure
Transaction updates arrive as SubscribeUpdateTransaction
messages:
Key Fields
signature
: Transaction signature (unique identifier)
is_vote
: Whether this is a vote transaction
meta
: Transaction metadata including status, fees, logs, and account changes
transaction
: The full transaction data including instructions
slot
: Slot number where transaction was included
index
: Transaction index within the block