Transaction Subscriptions
Transaction subscriptions provide real-time notifications whenever a transaction is processed on the Solana blockchain. Each notification includes complete transaction data with metadata, account changes, program logs, and execution results. Use powerful filtering options to focus on specific accounts, programs, or commitment levels.
For bandwidth-sensitive applications, enable metadataOnly mode to receive only transaction signatures, slots, and basic metadata without full transaction details.
Methods:
transactionsSubscribe- Subscribe to transaction notificationstransactionNotification- Notification message typetransactionsUnsubscribe- Unsubscribe from notifications
Common use cases:
- Monitoring transactions for specific accounts or programs
- Building real-time transaction explorers and analytics dashboards
- Tracking on-chain activity for wallets, DEXs, and NFT marketplaces
- Detecting and responding to specific transaction patterns
- Creating audit trails and compliance monitoring systems
- Streaming high-frequency trading data with verified mode for data correctness
Subscribe Request
Method: transactionsSubscribe
Parameters:
network (string, required)
The Solana network to subscribe to: solana-mainnet or solana-devnet
verified (boolean, optional)
When true, ChainStream waits for multiple validators to report the same transaction before sending a notification, providing additional data correctness guarantees. This can delay notifications by up to ~400ms (the approximate time for a processed block to become confirmed).
When false (default), transactions are streamed as quickly as possible without multi-validator verification.
Only supported when commitment is processed. Must be false for confirmed or finalized commitment levels.
Defaults to false.
filter (object, optional)
Filtering options to narrow down which transactions to receive.
commitment (string) — The commitment level of transactions to receive: processed, confirmed, or finalized. Defaults to processed.
excludeVotes (boolean) — Exclude vote transactions from the stream. Defaults to false.
metadataOnly (boolean) — When true, notifications include only transaction metadata (slot, signature, etc.) and omit full details such as program logs and instructions. Reduces bandwidth usage. Defaults to false.
accountKeys (object) — Filter transactions by account keys involved in the transaction:
all(array of strings) — All specified account keys must be present in the transactiononeOf(array of strings) — At least one of the specified account keys must be presentexclude(array of strings) — Exclude transactions containing any of these account keys
If both all and oneOf are provided in accountKeys, transactions must contain all keys in all AND at least one key in oneOf.
Filter Precedence
ChainStream applies filters in this order:
| 1. | commitment | Only transactions with the specified commitment level are considered |
| 2. | excludeVotes | Vote transactions are excluded if set to true |
| 3. | accountKeys.exclude | Transactions containing excluded keys are filtered out |
| 4. | accountKeys.all | Transactions must contain all specified keys |
| 5. | accountKeys.oneOf | Transactions must contain at least one specified key |
Example Subscribe Request
- Mainnet
- Devnet
{
"jsonrpc": "2.0",
"id": 1,
"method": "transactionsSubscribe",
"params": {
"network": "solana-mainnet",
"verified": false
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "transactionsSubscribe",
"params": {
"network": "solana-devnet",
"verified": false
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "transactionsSubscribe",
"params": {
"network": "solana-mainnet",
"verified": true,
"filter": {
"commitment": "processed",
"excludeVotes": false,
"metadataOnly": false
}
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "transactionsSubscribe",
"params": {
"network": "solana-mainnet",
"verified": false,
"filter": {
"commitment": "confirmed",
"excludeVotes": true,
"metadataOnly": false,
"accountKeys": {
"all": ["675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"],
"oneOf": [
"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
],
"exclude": ["Amf4jC8hM8uG4BP4stFHYUShTe7F4jKbiqvAL32D2piJ"]
}
}
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "transactionsSubscribe",
"params": {
"network": "solana-mainnet",
"verified": false,
"filter": {
"commitment": "processed",
"metadataOnly": true
}
}
}
Example Subscribe Response
Save the subscription ID if you need to explicitly unsubscribe before disconnecting. Disconnecting the WebSocket automatically unsubscribes all active subscriptions.
{
"jsonrpc": "2.0",
"result": 446257156701906,
"id": 1
}
Notification Structure
{
"jsonrpc": "2.0",
"method": "transactionNotification",
"params": {
"subscription": 446257156701906,
"result": {
"context": { ... },
"value": { ... }
}
}
}
context Object
slotStatus (string)
The commitment level of this transaction: processed, confirmed, or finalized
nodeTime (string)
ISO 8601 timestamp when the transaction was processed by the validator
isVote (boolean)
Whether this transaction is a vote transaction
signature (string)
The transaction signature (base58-encoded)
index (number)
The transaction's index within its block
value Object
slot (number)
The slot number in which the transaction was processed
transaction (object)
The transaction message and signature details. Contains message (with accountKeys, instructions, recentBlockhash, etc.) and messageHash.
meta (object)
Transaction metadata including err, fee, preBalances, postBalances, innerInstructions, logMessages, preTokenBalances, postTokenBalances, rewards, computeUnitsConsumed, and more.
Example Notification
{
"jsonrpc": "2.0",
"method": "transactionNotification",
"params": {
"subscription": 446257156701906,
"result": {
"context": {
"slotStatus": "confirmed",
"nodeTime": "2025-10-01T22:20:38.121983224Z",
"isVote": false,
"signature": "5k5MgvCWxrZ2haxKKDjigAp2oPoaCEYUf2Ct4qDfhUTTdmXasBg7x1affUmsd4j9KVZBivCLJr41ovAGp3WdtVpU",
"index": 62
},
"value": {
"slot": 370568409,
"transaction": {
"message": {
"accountKeys": [
"8Ka9upEwW3eMLaGXaw7pcrLRQ1coGfDRgBm5QrJSybA6",
"38d97WvZikZdaKCfqnz4zkVuiXhB7FsZJbex14FD2CDx"
],
"version": 0,
"header": {
"numReadonlySignedAccounts": 0,
"numReadonlyUnsignedAccounts": 5,
"numRequiredSignatures": 1
},
"instructions": [
{
"programIdIndex": 14,
"accounts": [15, 1, 16, 2, 3],
"data": "6AdegXA61wenW9vU89CqYvs"
}
],
"recentBlockhash": "3p6b4c9yPqsvogFcFfDkrfA2trx2izwjpCw1uV5KFrfu"
},
"messageHash": "FEh8Wvh4ex9XaisPaCF3fWmECnxCAWrhoz6RXCWWrthY"
},
"meta": {
"err": null,
"fee": 5000,
"preBalances": [21805750, 6124800],
"postBalances": [21800750, 6124800],
"innerInstructions": [],
"logMessages": [
"Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 invoke [1]",
"Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 success"
],
"preTokenBalances": [],
"postTokenBalances": [],
"rewards": [],
"computeUnitsConsumed": 28215
}
}
}
}
}
Metadata-Only Notification
When metadataOnly: true, the notification includes only essential metadata and omits detailed transaction data, log messages, and token balances:
{
"jsonrpc": "2.0",
"method": "transactionNotification",
"params": {
"subscription": 446257156701906,
"result": {
"context": {
"slotStatus": "processed",
"nodeTime": "2025-10-01T22:20:38.121983224Z",
"isVote": false,
"signature": "5k5MgvCWxrZ2haxKKDjigAp2oPoaCEYUf2Ct4qDfhUTTdmXasBg7x1affUmsd4j9KVZBivCLJr41ovAGp3WdtVpU",
"index": 62
},
"value": {
"slot": 370568409,
"meta": {
"err": null,
"fee": 5000,
"computeUnitsConsumed": 28215
}
}
}
}
}
Unsubscribe Request
Method: transactionsUnsubscribe
Parameters:
subscriptionId (number, required)
The subscription ID returned from the subscribe response (passed as array parameter).
Example Unsubscribe Request
{
"jsonrpc": "2.0",
"id": 2,
"method": "transactionsUnsubscribe",
"params": [446257156701906]
}
Example Unsubscribe Response
{
"jsonrpc": "2.0",
"result": true,
"id": 2
}
FAQ and Troubleshooting
When should I use ChainStream verified transactions?
Set verified: true when you need confirmation that multiple validators have processed a transaction before acting on it. This adds up to ~400 ms delay but provides additional correctness guarantees. Only use verified: true with commitment: "processed"; for confirmed or finalized, the network already provides the necessary consensus.
Can I filter ChainStream traffic by multiple account keys?
Yes. accountKeys filters support all (transaction must include all keys), oneOf (transaction must include at least one key), and exclude (transaction must not contain listed keys). Filters run in order: exclude, then all, then oneOf. Combine them to target just the transactions you care about. See the ChainStream API documentation for full examples.
How do I reduce ChainStream bandwidth usage?
Syndica offers Per-Message Deflate compression (RFC 7692) on every ChainStream endpoint—most clients negotiate it automatically, though some require enabling compression manually or adding an extra dependency to advertise permessage-deflate. For transaction-heavy streams, you can further trim payloads via metadataOnly: true, excludeVotes: true, and targeted accountKeys filters.
How do I use ChainStream with devnet?
Connect to wss://solana-devnet.chainstream.syndica.io/api-key/YOUR_API_KEY and set network: "solana-devnet" in your transactionsSubscribe (or other) params. The rest of the request shape matches mainnet usage, including verified, commitment, and filter objects.
Why is my ChainStream connection failing?
Common causes:
- Scale Mode not enabled (ChainStream requires it—upgrade or review plans/pricing).
- ChainStream not enabled on your dashboard’s ChainStream API page.
- No available streams / Error 7429 (
subscription method exceeded limit) (all subscriptions in use). Close unused streams or enable additional streams—see plans/pricing for details. - API key missing ChainStream permissions.
Check the ChainStream API page for subscription status and limits after resolving the above.
What You Can Do Next
- Block Subscriptions - Monitor block production and validator rewards
- Slot Subscriptions - Track slot status changes and commitment levels
- Encoded Block Subscriptions - Get complete block data with all transactions
- Connection Guide - WebSocket setup and error handling patterns