Decoding · November 18, 2026 · 7 min read

One transaction, many instructions: reading a real bot transaction in order

Real traffic rarely holds one instruction per transaction. Here is how to read a composed transaction from top to bottom and store it as one action with its setup steps attached.

Decode a multi instruction Solana transaction by reading every instruction in order and then naming one action for the whole thing. A typical bot transaction sets its fee, prepares a token account, swaps and pays a tip. Only the swap is the trade; the others are setup and payment, linked through the accounts they share.

A typical layout, top to bottom#

A decoder that handles one instruction at a time works well in tests and badly on live traffic, because traders rarely send a single instruction. The order below is common for an automated swap. It is a pattern, not a rule, so your decoder should never depend on positions.

  1. Compute budget. One or two instructions to the Compute Budget program set the compute unit limit and the price per unit. In a v1 transaction the limit and the total priority fee in lamports sit in the transaction's config fields (SIMD-0385); any Compute Budget instructions it still contains are ignored, so never read fees from them.
  2. Token account setup. A call to the Associated Token Account program creates the account that will receive the output token, usually with the idempotent variant so it succeeds whether or not the account already exists.
  3. Wrapping SOL. When the input is SOL, a System transfer moves lamports into a token account for the native mint, followed by a sync call to the SPL Token program.
  4. The swap. One instruction to a DEX program or an aggregator. This is the action the sender cares about.
  5. Cleanup. A close instruction to the SPL Token program returns the wrapped SOL account's rent to the owner.
  6. Tip. A System transfer of lamports to one of Jito's tip accounts, a payment to the leader for including the bundle.

The compiled instruction format explains why each of these is only a program index, a list of account indexes and some bytes until you map them back to keys.

Which instruction carries the real action#

Rank instructions by role rather than by position. A simple rule set covers most traffic:

  • Instructions to the Compute Budget program are fee settings. Read them, attach the values to the transaction row, and never report them as actions. Compute budget instructions lists what each one sets. To turn those values into the fee the sender actually paid, follow the priority fee calculation.
  • Associated Token Account creation and SPL Token sync and close calls are setup.
  • A System transfer is setup when its destination is a token account the transaction also uses, a tip when the destination is a known tip account, and a payment otherwise.
  • Anything addressed to a program on your decode list (a DEX, an aggregator, a launchpad) is a candidate action.

If exactly one candidate remains, that is the action. If two remain, keep both and mark the row as composite; a bot that swaps on two pools in one transaction is doing arbitrage, and collapsing it to one swap hides that.

Tip accounts change over time. Load them from the block engine's getTipAccounts call when your service starts, rather than writing the list into your code. Reading fees and tips shows the full routine.

Linking instructions through shared accounts#

The instructions in one transaction talk to each other through account keys. The token account created in step 2 shows up again as the destination of the swap in step 4. The wrapped SOL account funded in step 3 is the swap's source and is closed in step 5. Following those keys is how you prove that the setup belongs to the trade.

A practical method: for each candidate action, collect its writable accounts, then walk the other instructions and attach any that write to one of those keys. What is left over is either a tip, a fee setting or an unrelated instruction the sender happened to batch in. Keep the leftovers. An unrelated transfer inside a swap transaction is exactly what a wallet monitor wants to see.

For token accounts, associated token accounts explains how to map an account back to its owner and mint without asking an RPC node.

Pitfalls: repeated programs, wrapped SOL, closed accounts#

The same program twice. An aggregator route can call one DEX several times. Index every instruction by its position in the transaction and never key rows on the program alone.

Wrapped SOL that looks like a token trade. A transfer of the native mint is SOL in disguise. Report it as SOL, or your volume figures will count the same value twice: once as the System transfer that funded the account and once as the token movement.

Accounts that exist only inside the transaction. A token account can be created, used and closed within one transaction. If your decoder later asks an RPC node for that account's owner, it will find nothing. Capture everything you need from the instructions while you have them.

Aggregator routes. The outer instruction to an aggregator names the input amount and a minimum output, but the hops it makes happen as inner instructions during execution, which raw transactions never contain. Decoding Jupiter swaps covers where that line falls.

Format differences. Legacy and v0 transactions carry fee settings as instructions; v1 transactions carry them in config fields. A decoder that looks only for Compute Budget instructions will report v1 transactions as paying no priority fee. See the v1 transaction format.

A data model for multi instruction transactions#

Store the transaction once, every instruction once, and the interpreted action on top. Interpretations change as your rules improve; the instruction rows do not.

TableKeyHolds
transactionsfirst signatureslot, format (legacy, v0, v1), fee payer, compute unit limit and price, tip amount, status (provisional, then confirmed, failed or dropped)
instructionsfirst signature, instruction indexprogram id, account keys in order, raw data, role (fee setting, setup, tip, payment, candidate action, unknown)
actionsfirst signature, action numberkind (swap, transfer, create, composite), the instruction indexes it covers, decoded arguments, the rule version that produced it

The rule version column lets you reprocess old rows after you change the ranking rules, without touching the stored instructions.

What the instruction list cannot settle#

Instructions describe what the sender asked for. They cannot tell you whether the transaction succeeded, how much the swap actually returned, or which pools an aggregator touched in its inner calls. A transaction whose swap failed still paid its fee and may still have created its token account. Treat every action as provisional until you check the outcome against confirmed data, and keep the failed ones: they are part of the sender's behaviour too.

Start with the quickstart to get transactions out of the stream, then classify them with the rules above. For the transaction format itself, compiled instructions and the v1 format are the two pages to keep open. When you are ready to run the classifier on live traffic, a Standard feed gives you real raw traffic to test it against.

For a real composed transaction decoded field by field, see the Pump.fun launch walk-through.

Composed transactions are often v0, and those that reference a lookup table run into the lookup table problem, and the swap attribution post picks up where this one stops.

Sources#

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.

Read nextAlpenglow, seen from an indexer's chair