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:
stream.write({ 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: [], commitment: 2, // CONFIRMED}, callback);Filter by account address
stream.write({ accounts: { my_wallet: { owner: [], // filter by owner program account: [ // filter by exact account address "YourWalletAddress1111111111111111111111111111", ], filters: [], // mem-compare filters }, }, // ...}, callback);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 mintstream.write({ accounts: { usdc_holders: { owner: ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], account: [], filters: [ { memcmp: { // SPL token account: mint address starts at offset 0 offset: 0, base58: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // USDC mint } }, { // Only initialised accounts (state byte at offset 108 = 1) memcmp: { offset: 108, bytes: "1" } } ], }, },}, callback);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.