HosseinUntitled Query
Updated 2022-11-14Copy 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
›
⌄
with list as (
select
tx_signer as staker,
sum(stake_amount) / pow(10, 24) as staked_volume,
count(distinct(tx_hash)) as staked_num
from near.core.dim_staking_actions
where 1 = 1
and action = 'Stake'
and block_timestamp::date > '2022-11-01'
group by tx_signer
)
select
case
when staked_volume < 100 then '< 100'
when staked_volume < 1000 then '< 1000'
when staked_volume < 10000 then '< 10,000'
when staked_volume < 100000 then '< 100,000'
else '> 100,000' end as volume,
count(distinct(staked_num)) as staked_num,
count(distinct(staker)) as stakers_num
from list
group by volume
Run a query to Download Data