跳转到主要内容

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 first

Installation

Complete Working Example

Here’s a ready-to-use monitor that tracks account changes:

How to Filter Accounts

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

Use this to filter account types:
Common sizes:
  • Token accounts: 165 bytes
  • Mint accounts: 82 bytes
  • System accounts: 0 bytes (just SOL)
Use this to filter by specific data:
This checks if bytes at a specific offset match a value.
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

Monitor wallet or token balances in real-time. Get alerts when balances change significantly.
Track specific wallets and see all their account activity. Great for analyzing behavior patterns.
Monitor all accounts in your program to understand usage, track growth, and detect issues.
Get instant notifications when new accounts are created for your program or specific token mints.
Watch multiple token accounts to track portfolio changes and calculate total values.

Common Questions

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.
Yes! Just add them to the account array. You can watch hundreds of specific accounts at once.
  • CONFIRMED (~400ms): Faster, good for most uses. Supermajority of validators agree.
  • FINALIZED (~13 seconds): Slower but absolute certainty. Cannot be rolled back.
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.
Yes! Use a memcmp filter at offset 0 with the mint address. This will only show accounts for that specific token.
  • 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