Moeflow dec 5
    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

    case
    when n=1 then 'New Staker' else 'Older user' end as type,
    case
    when amount < 10 then 'under 10 FLOW'
    when amount >= 10
    and amount < 10 then '10-50 FLOW'
    when amount >= 50
    and amount < 100 then '50 - 100 FLOW'
    when amount >= 100
    and amount < 1000 then '100 - 1k FLOW'
    else 'over 1k Flow'
    end as tier,
    count (distinct delegator) as stakers

    from base
    where tx_succeeded = 'TRUE'
    group by 1,2


    Run a query to Download Data