mmdrezaWeekly top5 Validator stakers
Updated 2022-10-19Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
›
⌄
with
stake as (
select tx_hash
from near.core.fact_actions_events_function_call
where method_name in ('deposit_and_stake','stake','stake_all')
),
top_validator as (
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 5)
select
date_trunc('week',block_timestamp) as date,
tx_receiver as t_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 tx_receiver in (select validator from top_validator)
and block_timestamp >= current_date-90
group by 1,2
Run a query to Download Data