0xHaM-dTotal users copy
    Updated 2024-09-17
    with tb1 as (
    select
    block_number,
    block_timestamp,
    tx_hash,
    from_address as user
    from kaia.core.fact_transactions
    )

    select
    trunc(block_timestamp,'{{Time_Interval}}') as date,
    count(DISTINCT user) as users,
    count(DISTINCT block_number) as "Produced Blocks",
    count(DISTINCT tx_hash) as transactions,
    transactions/users as "Avg per User",
    avg(transactions) over (order by date rows between 6 preceding and current row) as "7d-MA # Txs"
    from tb1
    -- where block_timestamp::date < trunc(current_date,'d')
    group by 1


    QueryRunArchived: QueryRun has been archived