Moeflow dec 4
    Updated 2023-04-20
    with
    base as (
    select
    *,
    row_number()over(partition by delegator order by block_timestamp asc ) n
    from
    flow.core.ez_staking_actions where ACTION ilike '%Committ%')

    select
    date_trunc(week,BLOCK_TIMESTAMP)::date date ,
    case
    when n=1 then 'New Staker' else 'Older user' end as type,
    count (distinct delegator) as stakers,
    sum(AMOUNT) as AMOUNTs,
    avg(AMOUNT) as avg_AMOUNT

    from base
    where tx_succeeded = 'TRUE'
    group by date,type


    Run a query to Download Data