Ali3NUsers by #Transactions (Blast)
    Updated 2024-06-03
    with ethpricet as (
    select hour,
    avg (price) as ethprice
    from ethereum.price.ez_hourly_token_prices
    where token_address = lower ('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2')
    group by 1),

    userst as (
    select from_address as "Wallet Address",
    count (Distinct tx_hash) as "Transactions",
    count (Distinct block_timestamp::date) as "Active Days",
    sum (tx_fee) as "Paid Fees [ETH]",
    sum (tx_fee*ethprice) as "Paid Fees [USD]"
    from blast.core.fact_transactions t1 join ethpricet t2 on date_Trunc (hour,block_timestamp) = t2.hour
    where block_timestamp >= '2024-02-29 00:00:00.000'
    group by 1)

    select case when "Transactions" = '1' then '1 Transaction'
    when "Transactions" > 1 and "Transactions" <= 5 then '2 - 5 Transactions'
    when "Transactions" > 5 and "Transactions" <= 10 then '6 - 10 Transactions'
    when "Transactions" > 10 and "Transactions" <= 50 then '11 - 50 Transactions'
    when "Transactions" > 50 and "Transactions" <= 100 then '51 - 100 Transactions'
    when "Transactions" > 100 and "Transactions" <= 500 then '101 - 500 Transactions'
    when "Transactions" > 500 and "Transactions" <= 1000 then '501 - 1,000 Transactions'
    else '> 1,000 Transactions' end as type,
    count (Distinct "Wallet Address") as "Wallets"
    from userst
    group by 1
    order by 2 desc



    Auto-refreshes every 12 hours
    QueryRunArchived: QueryRun has been archived