hessMonthly New Users
    Updated 2024-06-28
    with fees as ( select DISTINCT tx_id -- remove Oracle txns
    from sei.core.fact_transactions
    where fee = '0usei'

    )
    ,
    users as ( select DISTINCT attribute_value as addresses,
    tx_id,
    block_timestamp
    from sei.core.fact_msg_attributes
    where attribute_key in ('sender','fee_payer','recipient','receiver')
    and attribute_value not in (select attribute_value
    from sei.core.fact_msg_attributes
    where attribute_key ilike '%contract_address%'
    and block_timestamp::date >= '2023-08-15')
    and tx_id not in (select tx_id from fees)
    and block_timestamp::date >= '2023-08-15'
    )
    ,
    new as ( select min(block_timestamp::date) as date,
    addresses
    from users
    group by 2)

    select trunc(date,'month') as monthly,
    count(DISTINCT addresses) as "New Users",
    sum("New Users") over (order by monthly asc) as "Cumulative New Users"
    from new
    where date >= '2023-08-15'
    group by 1
    QueryRunArchived: QueryRun has been archived