elsina2024-08-20: daily activity per user
    Updated 2024-10-19
    with users as (
    SELECT
    date_trunc('day', block_timestamp) as date,
    origin_from_address,
    count(DISTINCT tx_hash) as tx_count,
    count(DISTINCT pool_name) as pool_count,
    sum(amount_in_usd) as total_vol,
    FROM
    avalanche.defi.ez_dex_swaps
    WHERE
    date >= current_date - interval '30 days'
    GROUP BY
    date, origin_from_address
    )

    select
    date,
    avg(tx_count) as avg_tx_count_per_user,
    avg(total_vol) as avg_tot_vol_per_user,
    avg(pool_count) as avg_pairs_per_user
    from
    users
    group by
    date
    order by
    date asc
    QueryRunArchived: QueryRun has been archived