cybergenlab[DEX Overview] User Growth
    Updated 2024-11-16
    -- forked from [DeFi Overview] User Growth @ https://flipsidecrypto.xyz/studio/queries/ffc8d23d-91c9-4ad9-9d22-db441a417524

    --Get historical DeFi project user growth

    with monthly_new_users as (
    select
    date_trunc('month', block_timestamp) as time,
    label_type as category,
    count(distinct from_address) as new_users,
    from ethereum.core.fact_transactions as transactions
    left join ethereum.core.dim_labels labels on transactions.to_address = labels.address
    where block_timestamp < date_trunc('month',current_date())
    --block_timestamp >= dateadd(year, -3, date_trunc('month',current_date()))
    and nonce = 0
    and category in ('dex')
    and status = 'SUCCESS'
    group by 1,2
    )

    select
    time,
    new_users,
    sum(new_users) over (order by time) as users
    from monthly_new_users
    group by 1,2
    order by 1 desc










    QueryRunArchived: QueryRun has been archived