rok1996-eqOYgWtabtrb - taps pls actv copy
    Updated 2024-12-31
    -- forked from Hessish / tabtrb - taps pls actv @ https://flipsidecrypto.xyz/Hessish/q/-1fPx8wIIJOP/tabtrb---taps-pls-actv


    with x as
    (SELECT
    BLOCK_TIMESTAMP,
    signers[0] as player,
    TX_ID
    from eclipse.core.fact_transactions
    where
    SUCCEEDED = 'TRUE'
    and LOG_MESSAGES[0] like '%turboe9kMc3mSR8BosPkVzoHUfn5RVNzZhkrT2hdGxN%'
    and LOG_MESSAGES[1] = 'Program log: Instruction: Click'),

    stat as
    (select DISTINCT player,
    count(DISTINCT TX_ID) as tps
    from x
    group by all)

    select case
    when tps < 1000 then 'A. <1000 Taps'
    when tps >= 1000 and tps < 5000 then 'B. 1k~5k Taps'
    when tps >= 5000 and tps < 15000 then 'C. 5k~15k Taps'
    when tps >= 15000 and tps < 50000 then 'D. 15k~50k Taps'
    when tps >= 50000 and tps < 100000 then 'E. 50k~100k Taps'
    when tps >= 100000 and tps < 150000 then 'F. 100k~150k Taps'
    when tps >= 150000 and tps < 200000 then 'G. 150k~200k Taps'
    when tps >= 200000 and tps < 250000 then 'H. 200k~250k Taps'
    when tps >= 250000 and tps < 300000 then 'I. 250k~300k Taps'
    when tps >= 300000 then 'J. 300k+ Taps' end as "Activity level",
    count(DISTINCT player) as players,
    round((count(DISTINCT player) / (select count(DISTINCT player) from stat) * 100), 2) || '%' as percentage
    from stat
    group by all
    order by 1 asc
    QueryRunArchived: QueryRun has been archived