Afonso_Diazcategorized by number of txns
    Updated 2024-09-19
    with

    transactions as (
    select
    contract_address,
    tx_hash,
    block_timestamp,
    tx_fee,
    from_address as user
    from
    kaia.core.fact_event_logs
    join
    kaia.core.fact_transactions using (tx_hash, block_timestamp)
    where
    tx_succeeded = 1
    ),

    contracts as (
    select
    contract_address,
    count(distinct block_timestamp::date) as active_days,
    count(distinct tx_hash) as transactions,
    count(distinct user) as users
    from transactions
    group by 1
    order by transactions desc
    )

    select
    case
    when transactions =1 then '1 Transactions'
    when transactions < 10 then '2 - 9 Transactions'
    when transactions < 25 then '10 - 24 Transactions'
    when transactions < 50 then '25 - 49 Transactions'
    when transactions <= 250 then '50 - 250 Transactions'
    when transactions <= 500 then '251 - 500 Transactions'
    QueryRunArchived: QueryRun has been archived