OpenInfra.sh is now live - Solana infrastructure, included with every server. LEARN MORE HERE >

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:

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.