Afonso_Diaz2023-04-08 11:21 PM
    Updated 2023-04-08
    with t as (
    select
    proposer as user,
    min(block_timestamp::date) as min_date,
    count(distinct block_timestamp::date) as active_days
    from flow.core.fact_transactions
    group by 1
    ),

    t2 as (
    select avg(new_users) as daily_average_new_users
    from (
    select
    min_date as day,
    count(distinct user) as new_users,
    sum(new_users) over (order by day) as cumulative_new_users
    from t
    group by 1
    )
    ),

    t3 as (
    select
    count(distinct tx_id) as transactions,
    count(distinct proposer) as active_users,
    transactions / count(distinct block_timestamp::date) as daily_average_transactions,
    transactions / active_users as transactions_per_user
    from flow.core.fact_transactions
    )

    select * from t3 join t2
    Run a query to Download Data