0-MIDweekly new stakers
    Updated 2024-12-28
    with tab1 as (
    select date_trunc('minute',BLOCK_TIMESTAMP) as time
    --,sum(AMOUNT/1e6) as volume
    ,DELEGATOR_ADDRESS
    from axelar.gov.fact_staking
    where BLOCK_TIMESTAMP::date>='2024-01-01'and BLOCK_TIMESTAMP::date<='2024-03-31'
    and ACTION='delegate'
    and TX_SUCCEEDED='true'
    ),
    tab2 as (
    select date_trunc('week',time) as week
    ,DELEGATOR_ADDRESS
    ,row_number()over(partition by DELEGATOR_ADDRESS order by week) as time_row
    from tab1
    )
    select week
    ,count(DELEGATOR_ADDRESS) as new_stakers
    ,sum(new_stakers)over(order by week) as total_new_stakers
    from tab2
    where time_row=1
    group by 1





    QueryRunArchived: QueryRun has been archived