Overview
Account monitoring lets you track balance changes, data modifications, ownership transfers, and account creation/deletion events across Solana in real-time. This guide covers filtering strategies and implementation patterns for different use cases.Prerequisites: This guide assumes you’ve completed the Yellowstone gRPC Quickstart and have a working stream setup.
Account Filtering Options
Monitor individual accounts by public keyUse this when you know exactly which accounts to watch:
Best for: Monitoring specific token mints, known wallets, or critical program accounts
Data Slicing
Optimize bandwidth by requesting only specific byte ranges from account data:Practical Examples
Example 1: Monitor Large Token Holders
Track USDC accounts with significant balances:Example 2: Track Program Account Changes
Monitor all accounts owned by a specific program:Example 3: New Account Creation Monitoring
Track when new accounts are created:Filter Logic Reference
Understanding how filters combine:Filter Combination Rules
Filter Combination Rules
Account-level filters (AND logic):
account
ANDowner
ANDfilters
must all match if specified
- Any account in
account
array matches - Any owner in
owner
array matches
- All dataSize and memcmp filters must match
Common Filter Patterns
Common Filter Patterns
Token accounts for specific mint:SPL token accounts with minimum balance:Program-derived accounts:
Performance Considerations
Bandwidth Optimization
Use data slicing to request only needed bytesApply strict filters to reduce unnecessary updatesChoose appropriate commitment levels for your use case
Scale Management
Start with specific accounts before using owner filtersMonitor subscription volume and adjust filters as neededImplement backpressure handling for high-volume streams
Error Handling
Common account monitoring errors and solutions:Filter Too Broad
Filter Too Broad
Error: Receiving too much data or hitting rate limitsSolution: Add more specific filters:
- Use
dataSize
to match exact account types - Add
memcmp
filters for specific data patterns - Consider using
accountsDataSlice
to reduce bandwidth
No Updates Received
No Updates Received
Error: Stream connects but no account updates appearSolution:
- Verify account addresses are correct
- Check if accounts actually change frequently
- Try
PROCESSED
commitment for more frequent updates - Test with a known active account first