Moeavax dau 0
    Updated 2024-12-31
    WITH raw_tb as (
    select
    BLOCK_TIMESTAMP,AMOUNT_USD ,TX_HASH ,TRADER
    from arbitrum.vertex.ez_perp_trades
    where is_taker = TRUE
    union all

    select
    BLOCK_TIMESTAMP,AMOUNT_USD ,TX_HASH ,TRADER
    from arbitrum.vertex.ez_spot_trades
    where is_taker = TRUE
    )
    ,
    daus as (
    SELECT distinct
    TRADER as users,
    trunc(block_timestamp, 'week') as weeks,
    count(distinct trunc(block_timestamp, 'day')) as active_days
    from
    raw_tb
    group by
    1,
    2
    having
    active_days >= 4
    ),
    total_daus as (
    select
    count(distinct users) as users
    from
    daus
    ),
    total_users as (
    select
    count(distinct TRADER) as users
    from
    QueryRunArchived: QueryRun has been archived