kiacryptoinstruction type
    Updated 2022-10-08
    with base as (
    select
    case
    when inner_instruction ilike '%burn%' then 'Burn'
    when inner_instruction ilike '%mintTo%' then 'Mint'
    when inner_instruction ilike '%setAuthority%' then 'Set Authority'
    when inner_instruction ilike '%createAccount%' then 'Create Account'
    when inner_instruction ilike '%transfer%' then 'Transfer'
    end as event_name, *
    from solana.core.fact_events
    where
    program_id = 'HubbLeXBb7qyLHt3x7gvYaRrxQmmgExb7fCJgDqFuB6T' and
    succeeded = TRUE and
    inner_instruction is not null
    )

    select
    date_trunc('day', block_timestamp) as date,
    event_name,
    count(distinct tx_id) as count,
    sum(count) over(partition by event_name order by date) as cum_count,
    (select sum(iff(event_name = 'Burn', 1, 0)) / count(distinct tx_id) from base) * 100 as burn_tx_percentage,
    (select sum(iff(event_name = 'Mint', 1, 0)) / count(distinct tx_id) from base) * 100 as mint_tx_percentage,
    (select sum(iff(event_name = 'Set Authority', 1, 0)) / count(distinct tx_id) from base) * 100 as setAuthority_tx_percentage,
    (select sum(iff(event_name = 'Transfer', 1, 0)) / count(distinct tx_id) from base) * 100 as transfer_tx_percentage,
    (select sum(iff(event_name = 'Create Account', 1, 0)) / count(distinct tx_id) from base) * 100 as createAccount_tx_percentage
    from base
    group by 1, 2
    Run a query to Download Data