adriaparcerisasdau base swaps
    Updated 2024-03-21
    WITH
    daus as (
    SELECT
    distinct from_address as users,
    trunc(block_timestamp,'week') as weeks,
    count(distinct trunc(block_timestamp,'day')) as active_days
    from base.core.fact_transactions
    where origin_function_signature in ('0xfe029156','0x5c11d795','0x7ff36ab5')
    group by 1,2
    having active_days>=4
    ),
    active_users as (
    SELECT
    trunc(block_timestamp,'week') as date,
    case when from_address in (select users from daus) then 'DAU'
    else 'No DAU' end as type,
    count(distinct from_address) as n_users,
    count(distinct tx_hash) as txs
    from base.core.fact_transactions
    where origin_function_signature in ('0xfe029156','0x5c11d795','0x7ff36ab5')

    group by 1,2
    )
    select * from active_users
    where date>=current_date-interval '{{Months}} MONTHS'
    and date<current_date
    order by 1 asc



    QueryRunArchived: QueryRun has been archived