afonsoUntitled Query
    Updated 2023-01-20
    select
    date_trunc('day', b.block_timestamp)::date as day,
    count(distinct a.tx_hash) as stakes_count,
    count(distinct tx_signer) as stakers_count,
    sum(stakes_count) over (order by day) as cumulative_stakes_count,
    sum(stakers_count) over (order by day) as cumulative_stakers_count
    from near.core.fact_receipts a,
    lateral flatten(input => logs) c
    join near.core.fact_transactions b
    where c.value ilike any ('%unstaking%', '%withdrawing%')
    and b.block_timestamp >= '2022-12-01'
    and a.tx_hash = b.tx_hash
    group by day
    order by day
    Run a query to Download Data