Subscribe Request
Subscribe Request
The SubscribeRequest
message is the foundation of all Yellowstone gRPC subscriptions. It defines what data you want to receive and how you want to filter it.
Request Structure
A SubscribeRequest
contains multiple subscription types that can be combined in a single request:
Key Parameters
accounts
Map of account subscription filters. The key is a user-defined identifier for the subscription.
Type: map<string, SubscribeRequestFilterAccounts>
See Subscribe to Accounts for details.
slots
Map of slot subscription filters. The key is a user-defined identifier for the subscription.
Type: map<string, SubscribeRequestFilterSlots>
See Subscribe to Slots for details.
transactions
Map of transaction subscription filters. The key is a user-defined identifier for the subscription.
Type: map<string, SubscribeRequestFilterTransactions>
See Subscribe to Transactions for details.
blocks
Map of full block subscription filters. The key is a user-defined identifier for the subscription.
Type: map<string, SubscribeRequestFilterBlocks>
See Subscribe to Blocks for details.
blocks_meta
Map of block metadata subscription filters. The key is a user-defined identifier for the subscription.
Type: map<string, SubscribeRequestFilterBlocksMeta>
entry
Map of entry subscription filters. The key is a user-defined identifier for the subscription.
Type: map<string, SubscribeRequestFilterEntry>
Entries represent the unit of blockchain data between transactions and blocks. Entry subscriptions are advanced use cases for low-level block construction monitoring.
transactions_status
Map of transaction status subscription filters. Similar to transaction subscriptions but for transaction status updates.
Type: map<string, SubscribeRequestFilterTransactions>
Transaction status updates provide information about transaction execution status separately from full transaction data.
commitment
The commitment level for the subscription. Controls when updates are sent based on Solana’s confirmation status.
Type: optional CommitmentLevel
Values:
PROCESSED
- Fastest updates, can be rolled backCONFIRMED
- Supermajority vote received (recommended for most use cases)FINALIZED
- Fully finalized, cannot be rolled back
Default: CONFIRMED
accounts_data_slice
Specify which portions of account data to include in responses. Reduces bandwidth when you only need specific data ranges.
Type: repeated SubscribeRequestAccountsDataSlice
Structure:
Each slice specifies an offset and length to extract from account data.
from_slot
Start streaming from a historical slot. This allows you to replay up to 6000 slots of historical data.
Type: optional uint64
Behavior:
- If specified, streaming begins from this slot number
- All matching data from
from_slot
onwards will be sent - Historical data up to 6000 slots back is available (~40 minutes)
- If not specified, streaming begins from the current slot
Use Cases:
- Recover from application downtime
- Backfill historical data
- Test application logic against real historical events
- Debug specific slot ranges
ping
Can be used to send a ping to the server to maintain connection health.
Type: optional SubscribeRequestPing
Filter Identifiers
Each filter map uses string keys that you define. These identifiers are included in SubscribeUpdate
messages, allowing you to determine which filter matched the data.
Best Practices:
- Use descriptive identifiers (e.g., “usdc_accounts”, “swap_transactions”)
- Keep identifiers consistent across your application
- Use identifiers to route data to different handlers
Combining Multiple Subscriptions
You can combine multiple subscription types in a single request:
Response: SubscribeUpdate
The server responds with a stream of SubscribeUpdate
messages containing:
The filters
field contains the identifiers of the filters that matched this update.
Next Steps
Explore specific subscription types:
- Subscribe to Accounts - Real-time account updates
- Subscribe to Transactions - Transaction streaming
- Subscribe to Slots - Slot progression tracking
- Subscribe to Blocks - Full block data