mmdrezaTop10 Validators by Count of stakers
    Updated 2022-10-19
    with
    stake as (
    select tx_hash
    from near.core.fact_actions_events_function_call
    where method_name in ('deposit_and_stake','stake','stake_all')
    )
    select
    tx_receiver as validator,
    count(distinct tx_signer) as stakers,
    sum(tx:actions[0]:FunctionCall:deposit/pow(10,24)) as near_staked
    from near.core.fact_transactions
    where tx_hash in (select * from stake)
    and block_timestamp >= current_date-90
    group by 1
    order by 2 desc
    limit 10

    Run a query to Download Data