Solana swap attribution from raw transaction data rests on three fields readable from the signed transaction alone: the top level program called, the signers, and the fee payer. Together they show whether a trade went through a router or straight to a pool, and which wallet asked for it. Amounts per hop, and success, appear only after execution.
Three questions hiding in one word#
"Who made this swap" can mean three different things, and each needs different data:
- Which wallet wanted the trade? Usually the signer that owns the input token account.
- Which entry point did it use? A router, a launchpad, or a pool program called directly.
- Which venues filled it, and for how much? The pools that actually moved tokens.
The first two are visible in the signed transaction, so a decoder working on raw shreds can answer them. The third is only partly visible: a router that encodes its route in the instruction tells you the planned venues, but the amounts each one moved, and whether the trade succeeded at all, come from execution. Mixing these questions is how dashboards end up crediting volume to the wrong place.
Attribution rules you can apply from instruction data#
| Signal | Where it sits in the transaction | What it supports | What it cannot show |
|---|---|---|---|
| Top level program of the swap instruction | The program id index of each outer instruction | "Routed through an aggregator" or "sent straight to a pool" | Amounts moved at each hop |
| Signers | The first accounts in the key list, counted by the message header | The wallet that authorised the trade | Whether that wallet acts for someone else |
| Fee payer | Always the first account in the key list | Who paid to submit it, often a bot or relayer | Who owns the funds |
| Token accounts in the swap instruction | The account indexes the instruction lists | Input and output mints, once you know the layout | Amounts actually received |
| Other outer instructions | Compute budget, tip transfers, account creation | Bot style and setup steps | Whether the swap succeeded |
The top level program as the first signal#
Each outer instruction names a program by index into the account list. If the swap instruction's program is a known aggregator, such as the Jupiter v6 program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4, the trade was routed. If it is a pool program such as a Raydium, Orca or Meteora program, the user, or more often a bot, called the pool directly.
Keep a dated table of the program ids you recognise, taken from each project's official repository, and treat anything unknown as "unattributed" rather than guessing. The Jupiter recipe shows how to read the route instruction itself, and how swaps look as instructions explains the shared shape across exchanges.
One transaction can hold several outer swap instructions. Attribute each one separately, in order, rather than labelling the transaction as a whole.
Signer, fee payer and the wallet behind the trade#
The fee payer is always the first account. For a person trading from a wallet app it is usually the same key that signs for the token account, so signer and fee payer match. Bots and relayers break that link: a service account pays the fee while the user's key signs the swap, or one key pays for many users.
So use the signer that owns the input token account as the "who", and record the fee payer as a separate field. That keeps relayed flow from being credited to the relayer. The message header tells you how many accounts are signers and which are writable; account roles walks through those counts.
What cross program calls hide#
When a router fills a trade, it calls each pool program through cross program invocation. Those calls happen during execution and are recorded only as inner instructions in the transaction metadata. Raw shreds carry the signed transaction, not that metadata.
What you can read depends on the router. Jupiter's route instruction carries the route the quote produced, hop by hop, so the planned venues and the input amount are in the instruction data, along with a minimum output. What is missing is the result: the amount each hop returned, and whether the whole transaction succeeded. For a router whose program picks venues on chain, even the venues are only visible afterwards, and the account list it was handed is a set of candidates, not a record of use. What your decoder cannot see lists the other fields that stay hidden for the same reason.
Settling attribution with RPC afterwards#
For settled venue attribution, wait for the transaction to land and fetch it with the getTransaction RPC method. Its metadata includes the inner instructions and the token balance changes, which show which pools moved and by how much. A practical design writes two layers:
- an early row from raw data: signature, signer, fee payer, entry point, status "provisional";
- a settled row after confirmation: success or failure, venues used, amounts.
The same two layer idea drives early DEX volume, where the early numbers are labelled and later corrected.
When instruction level attribution misleads#
Early attribution is about intent. A routed swap can fail and still appear in the block, a bot can wrap a router call inside its own program so the top level program is the bot's, and a program upgrade can change an instruction layout overnight. If your report must say which venue earned the volume, only settled data answers that.
Keep going#
Pair this with account roles and the Jupiter recipe. When you are ready to run it on live transactions, see the plans and prices.
Swaps rarely travel alone: reading a composed transaction in order keeps each step in context, and the Token-2022 notes cover transfers where the amount received differs from the amount sent.
Attribution inside one slot depends on the order transactions appear in.
Sources#
- Solana docs: transactions (account list order, the fee payer is the first account) (checked 2026-11-18)
- Solana docs: cross program invocation (checked 2026-11-18)
- Jupiter CPI repository (Jupiter v6 program id in src/lib.rs) (checked 2026-11-18)
- solana-transaction-status 4.4.1, TransactionStatusMeta (inner instructions come from execution) (checked 2026-11-18)
- Solana RPC docs: getTransaction (innerInstructions in meta) (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.