hessTotal New USers
    Updated 2025-01-15
    with swap as ( select block_timestamp,
    tx_id,
    from_address,
    blockchain,
    pool_name,
    from_asset,
    to_asset,
    case when from_amount_usd is null then to_amount_usd else from_amount_usd end as amount_usd
    from thorchain.defi.fact_swaps)
    ,
    new_users as ( select min(block_timestamp::date) as date,
    from_address
    from swap
    group by 2)
    ,
    new as (select trunc(date,'week') as weekly ,
    count(DISTINCT from_address) as "New Users",
    sum("New Users") over (order by weekly asc) as "Cumulative New Users"
    from new_users
    group by 1)

    select sum("New Users") as total,
    avg("New Users") as avg
    from new
    where weekly >= '2024-01-01'


    Last run: 3 months ago
    TOTAL
    AVG
    1
    3685676701.218182
    1
    22B
    3s