Moeapt 1
    Updated 2023-12-08
    WITH
    daus as (
    SELECT distinct
    sender as users,
    trunc(block_timestamp, 'week') as weeks,
    count(distinct trunc(block_timestamp, 'day')) as active_days
    from
    aptos.core.fact_transactions
    group by
    1,
    2
    having
    active_days >= 4
    ),
    active_users as (
    SELECT
    case
    when sender in (
    select
    users
    from
    daus
    ) then 'DAU'
    else 'Other'
    end as
    type,
    count(distinct sender) as n_users,
    count(distinct tx_hash) as txs,
    txs / n_users as tx_per_user
    from
    aptos.core.fact_transactions
    group by
    1
    )
    select
    *
    Run a query to Download Data