par_rnTotal Solana Stake Transactions
    Updated 2022-12-24
    with delegate_table as (
    select count(*) as TX_Count
    from solana.core.fact_events
    where succeeded ='TRUE' and event_type = 'delegate' and event_type is not null),
    stake_table as (
    select count(*) as TX_Count
    from solana.core.fact_events
    where succeeded='TRUE' and (instruction:programId='Stake11111111111111111111111111111111111111' or event_type='delegate' or event_type='deactivate')),

    all_table as (
    select count(*) as TX_Count
    from solana.core.fact_events where succeeded='TRUE' and event_type is not null),

    table1 as (
    select avg(instruction:parsed:info:lamports/1e9) as Volume
    from solana.core.fact_events
    where instruction:parsed:info:lamports is not null and succeeded='TRUE' and event_type='split')

    select t1.tx_count as Delegate_Transactions,
    t2.tx_count as Stake_Transactions,
    t3.tx_count as All_Transactions,
    t4.Volume as Volume1,
    (Stake_Transactions/All_Transactions) * 100 as Stake_To_All_Ratio,
    (Delegate_Transactions/All_Transactions) * 100 as Delegate_to_All_Ratio
    from delegate_table t1
    join stake_table t2
    join all_table t3
    join table1 t4
    Run a query to Download Data