Overview
Account monitoring lets you watch Solana accounts as they change. Track balances, data updates, ownership changes, and when accounts are created or deleted - all in real-time.You’ll need: Run
npm install @triton-one/yellowstone-grpc firstInstallation
Complete Working Example
Here’s a ready-to-use monitor that tracks account changes:How to Filter Accounts
- Specific Accounts
- By Program Owner
- Advanced Filters
Watch specific accounts by their address:
More Examples
Example 2: Watch a Specific Wallet
Track a single wallet and see all its changes:Example 3: Watch Program Accounts
Track all accounts owned by a specific program:Example 4: Monitor with Data Slicing
Only download the data you need to save bandwidth:Understanding Token Account Data
SPL Token accounts are 165 bytes with this structure:Common Filters
Filter by Data Size
Filter by Data Size
Use this to filter account types:Common sizes:
- Token accounts: 165 bytes
- Mint accounts: 82 bytes
- System accounts: 0 bytes (just SOL)
Filter by Memory Compare (memcmp)
Filter by Memory Compare (memcmp)
Use this to filter by specific data:This checks if bytes at a specific offset match a value.
Combine Multiple Filters
Combine Multiple Filters
Use both together:All filters must match (AND logic).
Save Bandwidth with Data Slicing
Only download the parts of account data you need:Tips for Better Performance
Use Data Slicing
Only request the bytes you need to save bandwidth
Filter Smart
Use dataSize and memcmp to reduce updates
Pick Right Commitment
CONFIRMED is usually best for most use cases
Watch Your Volume
Monitor how many updates you’re receiving
What You Can Build
Balance Trackers
Balance Trackers
Monitor wallet or token balances in real-time. Get alerts when balances change significantly.
Wallet Watchers
Wallet Watchers
Track specific wallets and see all their account activity. Great for analyzing behavior patterns.
Program Analytics
Program Analytics
Monitor all accounts in your program to understand usage, track growth, and detect issues.
New Account Alerts
New Account Alerts
Get instant notifications when new accounts are created for your program or specific token mints.
Portfolio Tracking
Portfolio Tracking
Watch multiple token accounts to track portfolio changes and calculate total values.
Common Questions
How much data will I receive?
How much data will I receive?
It depends on your filters. Watching a single wallet = very little data. Watching all token accounts = a lot of data. Always use filters to limit what you receive.
Can I watch multiple accounts?
Can I watch multiple accounts?
Yes! Just add them to the
account array. You can watch hundreds of specific accounts at once.What's the difference between CONFIRMED and FINALIZED?
What's the difference between CONFIRMED and FINALIZED?
- CONFIRMED (~400ms): Faster, good for most uses. Supermajority of validators agree.
- FINALIZED (~13 seconds): Slower but absolute certainty. Cannot be rolled back.
How do I reduce bandwidth usage?
How do I reduce bandwidth usage?
Use data slicing (
accountsDataSlice) to only get the bytes you need. For example, if you only care about balances, just request bytes 64-71 instead of the full 165-byte account data.Can I filter by token mint?
Can I filter by token mint?
Yes! Use a memcmp filter at offset 0 with the mint address. This will only show accounts for that specific token.
What's the difference between account and owner filters?
What's the difference between account and owner filters?
- account: Specific account addresses you want to watch
- owner: All accounts owned by a program (like Token Program or your custom program)
Next Steps
Transaction Monitoring
Watch transactions too
Real Example: Pump.fun
See it in action
Best Practices
Optimize your code
Quickstart
Get started fast