afonsoUntitled Query
    Updated 2023-01-20
    with t as (
    select
    b.block_timestamp::date as day,
    count(distinct a.tx_hash) as unstakes_count,
    count(distinct tx_signer) as unstakers_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
    )

    select
    avg(unstakes_count) as average_unstakes_count,
    avg(unstakers_count) as average_unstakers_count
    from t
    Run a query to Download Data