Goldsky provides curated Solana datasets with full historical data, making it easy to build pipelines for blocks, transactions, instructions, and token activity. All datasets are pre-processed and optimized for common use cases.
Decode Solana program instructions using IDL (Interface Definition Language):
Copy
Ask AI
name: raydium-swap-trackerresource_size: msources: instructions: type: dataset dataset_name: solana.instructions version: 1.0.0 start_block: 312000000transforms: # Decode Raydium instructions using IDL decoded_instructions: type: sql primary_key: id sql: | SELECT id, program_id, _gs_decode_instruction_data( _gs_fetch_abi('https://gist.githubusercontent.com/jeffling/a5fbae53f47570c0e66980f9229fc83d/raw/02f3bd30b742fb1b1af0fbb40897aeeb77c7b941/raydium-swap-idl.json', 'raw'), data ) as decoded, accounts, block_slot, block_timestamp, signature FROM instructions WHERE program_id = 'CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C' # Extract decoded fields from the name and result JSON parsed_swaps: type: sql primary_key: id sql: | SELECT id, decoded.name as instruction_name, decoded.value as instruction_value, accounts[5] as token_in_account, accounts[6] as token_out_account FROM decoded_instructions where decoded.name = 'swap_base_input' or decoded.name = 'swap_base_output'sinks: postgres_swaps: type: postgres from: parsed_swaps schema: public table: raydium_swaps secret_name: MY_POSTGRES primary_key: id
Decoding functions:
_gs_decode_instruction_data(idl, data) - Decode instruction data using an IDL
_gs_fetch_abi(url, 'raw') - Fetch IDL from a URL
The decoded result includes the instruction name and parameters.
Track transaction patterns and success rates using SQL:
Copy
Ask AI
name: transaction-analyticsresource_size: msources: transactions: type: dataset dataset_name: solana.transactions version: 1.0.0 start_block: 312000000transforms: # Categorize transactions by fee and success tx_analysis: type: sql primary_key: id sql: | SELECT id, signature, block_slot, block_timestamp, status = 1 as is_successful, fee, compute_units_consumed, CASE WHEN fee < 5000 THEN 'low' WHEN fee < 50000 THEN 'medium' ELSE 'high' END as fee_category, CAST(compute_units_consumed AS DOUBLE) / CAST(fee AS DOUBLE) as compute_efficiency, _gs_op FROM transactionssinks: postgres_analytics: type: postgres from: tx_analysis schema: public table: solana_tx_analytics secret_name: MY_POSTGRES primary_key: id
Guide: Working with Transactions and Instructions Together
The transactions_with_instructions dataset provides a transaction-centric view with all instructions nested in an array. This is ideal when you need both transaction-level data and instruction details without joining separate datasets.
Analyze transaction success rates grouped by the programs involved:
Copy
Ask AI
name: program-success-analysisresource_size: msources: tx_with_instructions: type: dataset dataset_name: solana.transactions_with_instructions version: 1.0.0 start_block: 312000000transforms: # Extract program involvement program_transactions: type: sql primary_key: id sql: | SELECT id, signature, block_timestamp, status = '1' as is_successful, -- Get first instruction's program (typically the main program) instructions[1]['program_id'] as primary_program, -- Count unique programs in transaction array_length(instructions) as instruction_count, fee, compute_units_consumed, _gs_op FROM tx_with_instructions WHERE array_length(instructions) > 0sinks: postgres_analysis: type: postgres from: program_transactions schema: public table: program_transaction_analysis secret_name: MY_POSTGRES primary_key: id
To access individual instructions from the instructions array:Array indexing (1-based):
Copy
Ask AI
instructions[1] -- First instructioninstructions[1].program_id -- First instruction's programinstructions[1].data -- First instruction's data
Filtering arrays:
Copy
Ask AI
-- Get only Jupiter instructionsarray_filter(instructions, 'program_id', 'JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4')-- Get only top-level instructionsarray_filter(instructions, 'parent_index', null)-- Get first token program instructionarray_filter_first(instructions, 'program_id', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA')
Counting:
Copy
Ask AI
-- Total instructions in transactionarray_length(instructions)-- Instructions for specific programarray_length(array_filter(instructions, 'program_id', 'JUP6...'))
Use array_filter() and array_filter_first() SQL functions to work efficiently with the nested instruction arrays. See the SQL Functions Reference for more details.