Solana infrastructure, included with every server. LEARN MORE>

OpenInfra.shopeninfra.sh

Filtering

Server-side filters mean only the data you care about crosses the wire — no client-side drop needed.

Filter fields

FieldApplies toDescription
accountIncludeTransactionsInclude txns that touch any of these addresses
accountExcludeTransactionsExclude txns that touch any of these addresses
accountRequiredTransactionsInclude only txns that touch ALL of these
vote / failedTransactionsBoolean toggles for vote / failed txns
ownerAccountsInclude accounts owned by these programs
accountAccountsInclude specific account addresses
filters[].memcmpAccountsMemory-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.