matchMints flag lets a gRPC transaction subscription match on the token mints in a transaction’s pre/post token balances in addition to its account keys.
Put a mint in accountInclude, set matchMints: true, and you receive every transaction that touches that token: transfers, swaps, mint-to, burns, and account closes.
matchMints is available on LaserStream gRPC only. It is not available on LaserStream WebSocket yet.The problem: plain account filters miss most token transfers
When you watch a token withaccountInclude: [mint], you only match transactions where the mint pubkey appears in the transaction’s account keys.
A classic SPL Transfer instruction never references the mint. It only names the source token account, the destination token account, and the owner, so a plain account filter misses the most common operation on any token.
Only instructions that pass the mint directly match, such as MintTo, Burn, TransferChecked, and swaps whose program accounts include the mint. The only workaround was to stream all transactions and inspect each one’s token balances yourself.
How matchMints works
Set matchMints: true on a transaction filter and LaserStream builds a set of mints from the transaction’s preTokenBalances and postTokenBalances.
Your accountInclude, accountExclude, and accountRequired lists are then matched against both the account keys and that mint set. A mint qualifies if any token account for it appears in either balance list, regardless of whether the balance changed.
The flag is opt-in, and filters that omit it behave exactly as before, so you can add it to an existing subscription without changing what that subscription already receives. SPL and Token-2022 mints work because both programs populate pre/post token balances.
Semantics
The rest of the filter logic is unchanged:
- Predicates inside one named filter are still AND-combined (
vote,failed,signature, and the account lists). - Multiple named filters are still OR-combined.
- Values inside a list are OR (except
accountRequired, where all must match). - A transaction with no token balances falls back to keys-only matching.
matchMintsnever adds transactions that have no token activity. matchMintson its own does not restrict the stream. You still need at least one key or mint in an account list (or another restricting predicate) for the filter to be accepted.
LaserStream matches mints by exact pubkey. There is no “balance changed only” mode for mints, unlike
tokenAccounts: "balanceChanged".Use it in LaserStream gRPC
AddmatchMints: true to a transaction filter in your SubscribeRequest and put the mint in accountInclude. This example streams every USDC transaction on mainnet:
- TypeScript
- Rust
- Go
Requires
helius-laserstream 0.8.5 or later. The field is also accepted as match_mints.laserstream-core-proto 11.3.0 or later, or the .proto bundled in the SDK repo).
match_mints is field 32 of SubscribeRequestFilterTransactions. Clients generated from the upstream Triton proto silently drop the unknown field, so the flag has no effect until you regenerate.
See the Subscribe Request reference for every transaction filter field.
Combine with tokenAccounts to watch one token for one wallet
matchMints composes with tokenAccounts expansion, so one filter can match on wallet owners and mints at the same time.
This example streams every change to one wallet’s USDC balance:
accountInclude plus tokenAccounts finds transactions where the wallet’s token balances moved. accountRequired plus matchMints narrows those to the ones involving USDC.
Reading what matched
Once a transaction matches via a mint, look for the mint inmeta.preTokenBalances[].mint and meta.postTokenBalances[].mint. For plain transfers, the mint is usually absent from the account keys, so do not look for it there.
Diff preTokenBalances against postTokenBalances on the same accountIndex to see how much of the token moved and between which owners.
The Transaction Monitoring guide covers the transaction structure in detail.
Limits and notes
- Mints go in the same
accountInclude,accountExclude, andaccountRequiredlists as account keys, so they count toward the same per-list plan limits. There is no separate mint limit. - Matching cost does not scale with the number of mints you list. 100 mints and 100,000 mints perform the same, and subscribers that do not set the flag pay nothing.
- Historical replay honors
matchMints, so a replay subscription returns the same transactions the live stream would have returned. - If you attach a compressed (cuckoo) filter to a transaction subscription,
matchMintsprobes the mint set against it as well as the account keys. matchMintsis live on all LaserStream gRPC regions, mainnet and devnet. It is not available on LaserStream WebSocket at this time.- Minimum SDK versions: JavaScript/TypeScript
helius-laserstream0.8.5, Rusthelius-laserstream0.6.4, Gogo/v0.3.0.
Related
Token Account (ATA) Filtering
Match transactions that touch the token accounts a wallet owns
Transaction Monitoring
Full filtering strategies and runnable examples over gRPC
Subscribe Request Reference
Every transaction filter field, including
matchMintsHistorical Replay
Backfill up to 24 hours of token activity with the same filter