Overview
Filters define which updates you want to receive from the Geyser stream. Each filter type allows you to specify criteria for matching accounts, transactions, blocks, or slots.Account Filters
SubscribeRequestFilterAccounts
Filters for account updates.List of specific account public keys to subscribe to. If specified, you’ll only receive updates for these exact accounts.
List of program public keys. If specified, you’ll receive updates for all accounts owned by these programs.
Additional filter criteria for accounts (memcmp, datasize, token account state, lamports). Multiple filters are combined with AND logic.
If true, only include account updates that have an associated transaction signature. Useful for filtering out startup account loads.
Example: Subscribe to Specific Accounts
Example: Subscribe to All Token Program Accounts
Account Filter Types
SubscribeRequestFilterAccountsFilter
Memory comparison filter. Matches accounts where specific bytes at an offset match the provided data.
Data size filter. Matches accounts with exactly this many bytes of data.
Token account state filter. If true, matches valid SPL token accounts.
Lamports filter. Matches accounts based on their lamport balance.
SubscribeRequestFilterAccountsFilterMemcmp
Memory comparison filter for matching specific bytes in account data.Byte offset in the account data where the comparison should begin.
Data to compare at the offset. Provide in one of three formats:
bytes- Raw bytesbase58- Base58-encoded stringbase64- Base64-encoded string
Example: Memcmp Filter for Specific Mint
SubscribeRequestFilterAccountsFilterLamports
Filter accounts based on lamport balance.Equal to: matches accounts with exactly this many lamports.
Not equal to: matches accounts without exactly this many lamports.
Less than: matches accounts with fewer than this many lamports.
Greater than: matches accounts with more than this many lamports.
Example: Filter by Lamport Balance
Example: Combined Account Filters
Transaction Filters
SubscribeRequestFilterTransactions
Filters for transaction updates.Vote transaction filter:
true- Only vote transactionsfalse- Only non-vote transactionsnull(not set) - All transactions
Failed transaction filter:
true- Only failed transactionsfalse- Only successful transactionsnull(not set) - All transactions
Subscribe to updates for a specific transaction signature.
List of account public keys. If specified, only transactions that read or write to at least one of these accounts will be included.
List of account public keys. If specified, transactions that read or write to any of these accounts will be excluded.
List of account public keys. If specified, only transactions that read or write to ALL of these accounts will be included. More restrictive than
account_include.Example: Non-Vote Transactions Only
Example: Transactions Involving Specific Accounts
Example: Specific Transaction Signature
SubscribeRequestFilterDeshredTransactions
Filters for deshred transactions (received before execution).SubscribeRequestFilterTransactions but for pre-execution transactions. Does not include failed or signature filters since execution hasn’t occurred yet.
Vote transaction filter:
true- Only vote transactionsfalse- Only non-vote transactionsnull(not set) - All transactions
List of account public keys. Includes transactions that reference at least one of these accounts (including accounts loaded via address lookup tables).
List of account public keys. Excludes transactions that reference any of these accounts.
List of account public keys. Only includes transactions that reference ALL of these accounts.
Block Filters
SubscribeRequestFilterBlocks
Filters for block updates.List of account public keys. If specified, only blocks containing transactions that touch these accounts will be included. If empty, all blocks are included.
If true, include full transaction data in block updates. Default is false to reduce bandwidth.
If true, include full account update data in block updates. Default is false to reduce bandwidth.
If true, include entry data in block updates. Default is false.
Example: All Blocks with Transaction Data
Example: Blocks Involving Specific Accounts
SubscribeRequestFilterBlocksMeta
Filter for block metadata updates (without full transaction/account data).Example: Block Metadata Only
Slot Filters
SubscribeRequestFilterSlots
Filters for slot updates.If true, only send slot updates that match the commitment level specified in the
SubscribeRequest. If false or not set, send all slot status updates regardless of commitment.If true, send additional slot status updates between major commitment levels (e.g., FIRST_SHRED_RECEIVED, CREATED_BANK, COMPLETED). Default is false.
Example: All Slot Updates
Example: Commitment-Filtered Slots with Inter-Slot Updates
Entry Filters
SubscribeRequestFilterEntry
Filter for Proof of History entry updates.Example: Entry Updates
Commitment Levels
CommitmentLevel Enum
Defines when updates are sent based on confirmation status.Updates sent as soon as the transaction/block is processed by a validator. Fastest but may be subject to rollback.
Updates sent after the block is confirmed by a supermajority of the cluster. Default level. Balance between speed and safety.
Updates sent only after the block is finalized (rooted). Safest but slowest. Immune to rollbacks.
Related
- SubscribeRequest - Main request message that uses these filters
- Account Messages - Account update message details
- Transaction Messages - Transaction update message details
- Block Messages - Block update message details
- Slot Messages - Slot update message details