Yellowstone gRPC filters: what each field does and how they combine
Published . Updated .
An unfiltered Yellowstone Subscribe stream sends everything. The filters in SubscribeRequest decide what the server sends you. Field names below are from geyser.proto; semantics are from the README.
The filter kinds
SubscribeRequest holds one map per update kind, from a name you choose to a filter:
| Field | Delivers | Filter fields |
|---|---|---|
accounts | account updates | account, owner, filters |
transactions | transactions with status meta | vote, failed, signature, account_include, account_exclude, account_required |
slots | slot status changes | filter_by_commitment |
blocks | full blocks | account_include, include_transactions, include_accounts, include_entries |
blocks_meta | block metadata, without transactions, accounts or entries | none: every block is sent |
Every SubscribeUpdate carries filters: the names of the filters it matched. Use it to route updates when one stream runs several filters.
Transaction filter fields
vote-- unset: no constraint.true: only vote transactions.false: no vote transactions.failed-- unset: no constraint.true: only failed transactions.false: only successful ones.signature-- only this one transaction.account_include-- the transaction uses any account in the list.account_exclude-- the transaction uses none of the accounts in the list.account_required-- the transaction uses every account in the list.
How filters combine
| Where | Rule |
|---|---|
| Fields inside one filter | AND |
Values inside one list (account_include, account, owner) | OR: any value matches |
account_required | every value must be present |
The accounts filters list (memcmp, datasize) | AND: every condition must hold |
| Several named filters in one map (transactions, accounts) | OR. A matching update is sent once, with every matching name in filters. |
Several named filters in blocks | Each matching filter sends its own copy of the block. |
| A filter with all fields empty | Matches everything, votes and failures included. |
Commitment
commitment is one field for the whole request: PROCESSED, CONFIRMED or FINALIZED. Processed arrives first and can belong to a fork that is later dropped; finalized arrives last and is final. Set it explicitly. If you need two levels, open two streams.
On slots, filter_by_commitment: true sends only the slot status that equals your commitment; by default slots are sent for every level.
Examples
These use the Node client from the quickstart: replace its stream.write(...) call with the request shown. EMPTY holds the empty maps, as the quickstart passes them. The wallet and non-vote examples show only the transactions map that changes.
const EMPTY = {
accounts: {}, slots: {}, transactions: {}, transactionsStatus: {},
blocks: {}, blocksMeta: {}, entry: {}, accountsDataSlice: [],
}
One program's transactions:
stream.write({
...EMPTY,
commitment: CommitmentLevel.CONFIRMED,
transactions: {
program: {
vote: false,
accountInclude: ['<PROGRAM_ID>'], accountExclude: [], accountRequired: [],
},
},
})
failed is left unset, so failed calls to the program arrive too. Add failed: false to drop them.
One wallet:
transactions: {
wallet: { accountInclude: ['<WALLET>'], accountExclude: [], accountRequired: [] },
},
This matches transactions that use the wallet's address: anything it signs, and SOL transfers to it. An SPL token transfer uses the token accounts, not the wallet address, so to see incoming tokens add the wallet's token accounts to accountInclude.
Everything except votes:
transactions: {
nonvote: { vote: false, accountInclude: [], accountExclude: [], accountRequired: [] },
},
Every account owned by a program:
stream.write({
...EMPTY,
commitment: CommitmentLevel.CONFIRMED,
accounts: {
state: { account: [], owner: ['<PROGRAM_ID>'], filters: [] },
},
})
Account updates arrive in update.account, not update.transaction, so the quickstart's handler skips them. Read them like this:
stream.on('data', (update) => {
const acc = update.account?.account
if (!acc) return
console.log(bs58.encode(acc.pubkey), update.filters)
})
To narrow by content, add memcmp or datasize conditions to filters; all of them must hold.
Common mistakes
- Leaving
voteunset and expecting no votes. Unset means both. Writevote: false. - Expecting two named filters to intersect. They are OR. Put the conditions in one filter to AND them.
- Setting
accountandownerin one filter, meaning OR. It is AND: this pubkey, and owned by this program. For OR, use two named filters.
Mach gRPC
Mach gRPC provides a Yellowstone-compatible Geyser gRPC stream with these filters applied on the server: $300 / month flat, paid in USDC, access by IP allowlist with no API key. The quickstart takes you from sign-up to transactions on screen.
- Test it first. A short trial is available before you commit. Ask us for the details.
- Migration support in your first month. We help you move your setup over.
Ask us on Discord.