JonasoFlow : user : stake
    Updated 2024-09-08
    with

    X as( select block_timestamp, delegator, tx_id from flow.gov.ez_staking_actions ),

    A as(
    select date_trunc('month',block_timestamp) as time, count(distinct delegator) as delegator
    from X
    where year(block_timestamp) = '2024'
    group by 1),

    B as(
    select date_trunc('month',block_timestamp) as times, count(distinct delegator) as delegators
    from (select delegator, min(block_timestamp) as block_timestamp from X group by 1)
    where year(block_timestamp) = '2024'
    group by 1)

    select
    time, delegator, delegators,
    'active delegators' as A,
    'new delegators' as B
    from A as a
    left join B as b on a.time = b.times
    order by 1 desc






    QueryRunArchived: QueryRun has been archived