lagandispenserSolana Transactions Success Rate
    Updated 2022-07-13
    with Success_table1 as (select block_timestamp::date as date,count (*) as Success_count from solana.core.fact_transactions where succeeded = 'TRUE' and block_timestamp::date >= CURRENT_DATE - 30
    group by 1 order by 1),

    all_table1 as (select block_timestamp::date as date,Count (*) as countt from solana.core.fact_transactions where block_timestamp::date >= CURRENT_DATE - 30
    group by 1 order by 1),

    Success_table2 as (select block_timestamp::date as date,count (*) as Success_count from solana.core.fact_transactions where succeeded = 'TRUE' and block_timestamp::date >= '2022-01-01' and block_timestamp::date <= CURRENT_DATE - 30
    group by 1 order by 1),

    all_table2 as (select block_timestamp::date as date,Count (*) as countt from solana.core.fact_transactions where block_timestamp::date >= '2022-01-01' and block_timestamp::date < CURRENT_DATE - 30
    group by 1 order by 1)


    select 'Month' as type,t1.date, (t1.Success_count / t2.countt) * 100 as Success_rate from Success_table1 t1 join all_table1 t2 on t1.date = t2.date

    union

    select 'Year' as type, t1.date, (t1.Success_count / t2.countt) * 100 as Success_rate from Success_table2 t1 join all_table2 t2 on t1.date = t2.date
    Run a query to Download Data