saeedmzn[Kaia active users review ] - Total
    Updated 2024-10-16
    with klay_price as (
    select date_trunc(day,HOUR)::date BLOCK_TIMESTAMP ,
    median(PRICE) usd_price
    from kaia.price.ez_prices_hourly
    where symbol = 'KLAY'
    and date_trunc(day,HOUR)::date >='2024-01-01'
    group by 1

    )
    select
    count (DISTINCT tx_hash) num_transactions ,
    count (DISTINCT FROM_ADDRESS) num_active_users ,
    sum (TX_FEE* usd_price) Total_fee_USD ,
    sum (TX_FEE) Total_fee ,
    num_transactions/num_active_users avg_tx_per_wallet ,
    num_transactions / count(DISTINCT t.BLOCK_TIMESTAMP::date) avg_tx_per_day
    from kaia.core.fact_transactions t left join klay_price p
    on (t.BLOCK_TIMESTAMP::date = p.BLOCK_TIMESTAMP )
    where t.BLOCK_TIMESTAMP::date >='2024-01-01'
    QueryRunArchived: QueryRun has been archived