Filtering
Server-side filters mean only the data you care about crosses the wire — no client-side drop needed.
Filter fields
| Field | Applies to | Description |
|---|---|---|
| accountInclude | Transactions | Include txns that touch any of these addresses |
| accountExclude | Transactions | Exclude txns that touch any of these addresses |
| accountRequired | Transactions | Include only txns that touch ALL of these |
| vote / failed | Transactions | Boolean toggles for vote / failed txns |
| owner | Accounts | Include accounts owned by these programs |
| account | Accounts | Include specific account addresses |
| filters[].memcmp | Accounts | Memory-compare filter on account data bytes |
Filter by program (transactions)
Receive only transactions that include a specific program in their account list:
const request = { transactions: { // Key can be any string — used to name/replace this filter jupiter_swaps: { vote: false, failed: false, // Only transactions that touch the Jupiter v6 program accountInclude: ["JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"], accountExclude: [], accountRequired: [], }, }, slots: {}, accounts: {}, blocks: {}, blocksMeta: {}, accountsDataSlice: [], transactionsStatus: {}, entry: {}, commitment: CommitmentLevel.CONFIRMED,}; const stream = await client.subscribe(request);Filter by account address
const request = { accounts: { my_wallet: { owner: [], // filter by owner program account: [ // filter by exact account address "YourWalletAddress1111111111111111111111111111", ], filters: [], // memory-compare filters nonemptyTxnSignature: false, }, }, // Include the other empty request maps shown in the subscribing guide.}; const stream = await client.subscribe(request);Memory-compare filters
Use memcmp to filter on raw bytes at a given offset in the account data. Useful for token accounts, specific struct fields, or enum discriminators:
// SPL token accounts owned by a specific mintconst request = { accounts: { usdc_holders: { owner: ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], account: [], filters: [ { memcmp: { // SPL token account: mint address starts at offset 0 offset: 0, base58: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", } }, { // Match the desired state byte at the documented account offset. memcmp: { offset: 108, bytes: "2" } } ], }, },}; const stream = await client.subscribe(request);Combining filters
- Multiple entries in the accounts or transactions map run in parallel — any match triggers a notification.
- Within a single entry, accountInclude items are OR'd together.
- accountRequired items are AND'd — all must be present.
- accountExclude is applied after the include set.
- memcmp filters within a single account entry are AND'd.