Filter right after you parse each transaction, before you resolve lookup tables. At that point the top-level program IDs are already known, because Solana requires them to be static keys, so a program filter misses no top-level call there. Filters on other accounts are different: some keys hide in lookup tables, so apply those only after resolution.
What you can filter on at each stage#
Each stage of a decoding pipeline knows a little more than the one before it, and costs more to run. A filter belongs at the earliest stage that already holds the field it tests.
| Stage | What you know there | What a filter at this stage can test | What it costs to reach |
|---|---|---|---|
| Packet | Slot, shred index, FEC set | Slot ranges only | Almost nothing |
| Entry | The ordered transactions of a batch | Nothing about content yet | Recovery and deshredding |
| Parsed transaction | Signatures, static account keys, the program of each top-level instruction, the message format | Program IDs, the fee payer, any static key | Parsing the message header and key list |
| Resolved transaction | The full account list, including keys from lookup tables | Any account the transaction touches | Lookup table state, kept current |
| Decoded instruction | Arguments, named accounts | Amounts, mints, pools, instruction names | Layouts or IDLs per program |
| Confirmed outcome | Success or failure, balances, logs | Anything about the result | An RPC call or stream per transaction |
The parsed transaction stage is the sweet spot for the first cut. It is cheap to reach, and for most workloads the question "does this transaction call a program I care about?" removes the bulk of the traffic.
Why program IDs are safe to check early#
In a v0 message, the program of every top-level instruction must be one of the static account keys. The Solana SDK's own validation says so plainly: program ids cannot be loaded from a lookup table, so that tools can inspect a transaction's programs without loading any chain data. Legacy messages have no lookup tables at all, and neither do v1 transactions under SIMD-0385.
So a program ID filter applied right after parsing sees every top-level call, in every format, with no state. That is a strong guarantee, and it is the reason this filter can safely sit first. Filtering by program ID has the code; the program IDs page lists the common ones with their sources.
The lookup table catch: accounts you cannot see yet#
The same guarantee does not hold for other accounts. A v0 transaction can reference a pool, a token account or a wallet through a lookup table, by index only. Until you resolve the table, those keys are not in your hands.
If your filter is "transactions that touch wallet W" and W sits in a lookup table, a filter placed before resolution drops the transaction and you never know. The lookup table problem explains why that resolution needs account state from outside the packet.
The practical consequence: program filters go first, account filters go after resolution. If resolving every transaction is too expensive, resolve only the ones that already passed the program filter.
False negatives and how to count them#
Even a correctly placed program filter has blind spots, and you should count them rather than hope they are small.
- Calls made from inside another program. If program A calls your target program B through a cross-program invocation, B never appears as a top-level instruction. Raw transactions do not contain inner instructions, which are produced only when the transaction executes. A filter on B misses these entirely.
- Unknown lookup tables. An account filter after resolution still misses transactions whose lookup table you could not load in time.
- Programs you forgot. A protocol that deploys a new program version under a new ID falls outside a hard-coded list.
To measure the first two, sample a small share of the transactions your filter rejected, fetch their confirmed versions through RPC, and check whether any of them involved your target. That gives you an observed miss rate instead of a guess.
A two-stage filter design#
- Parse each transaction's header, static keys and top-level instructions. Keep it if any instruction's program is on your list; otherwise drop it immediately.
- For the survivors, resolve lookup tables and build the full account list.
- Apply account filters (wallets, pools, mints) to the full list.
- Decode instructions only for transactions that pass both stages.
- Record how many transactions each stage dropped, and run the sampled miss check from the previous section daily.
- If your workload depends on calls made from inside other programs, add the wrapping programs to the stage 1 list, and treat the result as a candidate to confirm later.
What no filter placement can recover#
Placement decides what you discard. It cannot add information the transaction does not carry. Inner calls, execution results and the actual output of a swap are missing from raw transactions at every stage, and only confirmed data supplies them. If your workload is defined by what happened inside execution rather than by what was requested, raw shreds plus a filter will always under-count, and a source that delivers executed data fits better.
Keep reading#
The decoding pipeline stages show where each of these steps lives in code. What decoding costs in CPU explains how to measure what a filter saves you, using your own servers. To try the two-stage design on real traffic, a Standard Shreds destination carries the raw stream to your server.
Reading a composed transaction in order shows what a single program filter can miss when one transaction calls several programs.
Sources#
- solana-sdk v0 message: program ids cannot be loaded from lookup tables (sanitize) (checked 2026-11-18)
- Solana docs: transactions and instructions (checked 2026-11-18)
- Solana improvement document 0385, the v1 transaction layout (checked 2026-11-18)
- solana-transaction-status 4.4.1, TransactionStatusMeta (inner instructions come from execution) (checked 2026-11-18)
Raw shreds on your own server
Ultra Low Latency Shreds is $200 and Standard Shreds is $100. You pay in crypto, tell us which IPv4 address and UDP port should receive the stream, and we wire it up by hand.