Solana Decoded Tables
Decoded tables for Solana programs
Decoded tables inherit all of the columns from instruction_calls
, so you can refer there for most of the types. We only add columns for each argument in the function call data
and each account that was required to be in account_arguments
. These only decode from instructions, and not inner instructions.
Example IDL Decoded Walkthrough
Using an IDL, we decode the function data arguments and the required account arguments. Let’s look at an example using Whirlpool - normally you can find the IDL on Solscan, but this time we had to dig into the project repo. IDLs are like ABIs on Ethereum, except they are created from the Anchor lang project instead of natively from every program.
Here’s a transaction of a pool (a trading pair) being initialzed.
You can see that the instruction data is decoded in “Bumps”, “TickSpacing”, and “InitialSqrtPrice” on the explorer. We have the same thing in a SQL table! You can also see all the account names are labelled clearly as well with an account_
prefix. Raw table inherited columns like tx_id
, block_time
, tx_index
get a call_
prefix.
The main thing to note is that we’ve exploded outer and inner instructions, where the index will match what you see on explorers. This example call is at the outer instruction level, so the inner instruction index is null. For Whirlpool swaps, often times it will happen in inner_instructions so then the top level outer instruction is inherited into the call_outer_instruction_index
and the inner index is call_inner_instruction_index
(same idea with the call_outer_executing_account
and call_inner_executing_acount
)
Try it out for yourself in this query below:
The table name follows the pattern:
<namespace>_solana.<programName>_call_<instructionName>
We already have many of the top projects decoded, so go play around!
Was this page helpful?