Updated 2024-05-31
    -- forked from flipflop / Mangrove Volume @ https://flipsidecrypto.xyz/flipflop/q/J_ieJ4Mwv27l/mangrove-volume

    with hashes as ( select DISTINCT tx_hash,
    block_timestamp,
    from_address as user,
    from blast.core.fact_transactions
    where tx_hash in (select DISTINCT tx_hash from blast.core.fact_transactions
    where to_address = lower('0x83251E7F36a51c5238C9aa0c6Bb7cc209b32d80e')
    )
    )
    ,
    new as (select min(block_timestamp) as date,
    user
    from hashes
    group by 2)

    select date::date as day,
    count(DISTINCT user) as new_users,
    sum(new_USERS) over (order by day asc) as cumulative_new_users
    from new
    group by 1
    ORDER BY 1 DESC