adriaparcerisasdau sei staking
    Updated 2023-08-21
    WITH
    daus as (
    SELECT
    distinct delegator_address as users,
    trunc(block_timestamp,'week') as weeks,
    count(distinct trunc(block_timestamp,'day')) as active_days
    from sei.core.fact_staking
    group by 1,2
    having active_days>=4
    ),
    active_users as (
    SELECT
    trunc(block_timestamp,'week') as date,
    case when delegator_address in (select users from daus) then 'DAU'
    else 'No DAU' end as type,
    count(distinct delegator_address) as n_users,
    count(distinct tx_id) as txs
    from sei.core.fact_staking
    where tx_succeeded=TRUE
    group by 1,2
    )
    select * from active_users
    where date<current_date
    order by 1 asc






    Run a query to Download Data