Tobi_12024-05-28 02:23 PM
    Updated 2024-05-28
    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 >= 2
    ),
    active_users as (
    SELECT
    trunc(x.block_timestamp, 'week') as date,
    SUBSTRING(
    PAYLOAD_FUNCTION,
    1,
    CHARINDEX('::', PAYLOAD_FUNCTION) - 1
    ) as to_address,
    count(distinct x.sender) as n_user,
    count(distinct x.tx_hash) as txs
    from
    aptos.core.fact_transactions x
    where
    sender in (
    select
    users
    from
    daus
    )
    group by
    1,
    2
    ),
    QueryRunArchived: QueryRun has been archived