flyingfishLooking for a Solana program id instruction names
    Updated 2025-01-09
    with
    logs as (
    select
    block_timestamp
    , tx_id
    , program_id
    , index
    , substr(utils.udf_base58_to_hex(instruction:data), 3, 16) as fun_hex
    , instruction
    , inner_instruction
    , log_messages
    from solana.core.fact_transactions
    join solana.core.fact_events using(block_timestamp, tx_id)
    where 1 = 1
    and block_timestamp > current_date - {{lookback_days}}
    and program_id = '{{program_address}}'
    and succeeded
    )

    , flattened_logs as (
    select
    logs.*
    , f.index as log_index
    , f.value as log_msg
    , CASE
    WHEN LOG_MSG LIKE '% invoke [%' THEN log_msg
    ELSE NULL
    END AS program_invocation
    from logs
    , lateral flatten (input => log_messages) f
    )

    , filtered_logs as (
    select
    flattened_logs.*
    , LAST_VALUE(program_invocation IGNORE NULLS)
    Last run: 2 months ago
    No Data to Display
    0
    2B
    41s