ArioBase DEXs Active users
    Updated 2024-04-09
    with twenty_four as (
    select
    count(distinct ORIGIN_FROM_ADDRESS) as "# 24h Users"
    from base.defi.ez_dex_swaps
    where block_timestamp >= current_date - interval '24 hour'
    ),
    thirty_days as (
    select
    date_trunc(day, block_timestamp) as day,
    count(distinct ORIGIN_FROM_ADDRESS) as "30D users",
    avg("30D users") over(order by day rows between 29 preceding and current row) as "# of Users - MA 30d"
    from base.defi.ez_dex_swaps
    group by 1
    order by day DESC
    limit 1
    )
    select
    "# 24h Users",
    "# of Users - MA 30d",
    ("# 24h Users" - "# of Users - MA 30d") / "# of Users - MA 30d" * 100 as "24h Growth"
    from twenty_four, thirty_days
    QueryRunArchived: QueryRun has been archived