DrsimonUntitled Query
Updated 2023-01-28
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
32
33
34
35
36
›
⌄
with year2022 as
(
select action, count(*) as staking_count , sum(stake_amount/1e24) as staking_amount ,avg(stake_amount/1e24) as avg_staking_amount
from near.core.dim_staking_actions
where year(block_timestamp::date)=2022
group by 1
)
, year2023 as
(
select action , count(*) as staking_count , sum(stake_amount/1e24) as staking_amount ,avg(stake_amount/1e24) as avg_staking_amount
from near.core.dim_staking_actions
where year(block_timestamp::date)=2023
group by 1
)
, chart as
(
select action , block_timestamp::date , count(*) as staking_count , sum(stake_amount/1e24) as staking_amount ,avg(stake_amount/1e24) as avg_staking_amount
from near.core.dim_staking_actions
where year(block_timestamp::date) >= 2022
group by 1,2
)
, stake_2022 as
(
select count(*) as staking_count , sum(stake_amount/1e24) as staking_amount , count(distinct tx_signer) as users
from near.core.dim_staking_actions
where action='Stake' and year(block_timestamp::date)=2022
)
, unstake_2022 as
(
select count(*) as staking_count , sum(stake_amount/1e24) as staking_amount , count(distinct tx_signer) as users
from near.core.dim_staking_actions
where action='Unstake' and year(block_timestamp::date)=2022
Run a query to Download Data