cristinatintoluna metrics dao open bounty 2
    Updated 2022-11-30
    with tab1 as (
    select
    distinct tx_from[0]::string as users,
    min(block_timestamp) as debut
    from terra.classic.fact_transactions where len(tx_from[0])<50
    group by 1
    having debut between '2022-01-01' and '2022-05-26'
    ),
    tab2 as (
    select
    distinct tx_sender as users,
    min(block_timestamp) as debut
    from terra.core.fact_transactions where tx_sender not in (select users from tab1)
    group by 1
    ),
    tab3 as (
    select 'LUNC' as token, * from tab1 where debut between '2022-01-01' and '2022-05-26'
    union select 'LUNA 2.0' as token, * from tab2 where debut >'2022-05-26'
    )
    select date_trunc('week',debut) as weeks,
    token,
    count(distinct users) as new_users,
    sum(new_users) over (partition by token order by weeks) as cum_new_users
    from tab3
    group by 1,2
    order by 1 asc
    Run a query to Download Data