ArashhNear mega 7
Updated 2022-12-31Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
›
⌄
select
date_trunc('day',BLOCK_TIMESTAMP ) as date,
sum(case when ACTION='Stake' then STAKE_AMOUNT/1e24 else null end) as staking_volume,
sum(case when ACTION='Unstake' then STAKE_AMOUNT/1e24 else null end) as unstaking_volume,
count(case when ACTION='Stake' then 1 else null end) as staking_number,
count(case when ACTION='Unstake' then 1 else null end) as unstaking_number,
sum(staking_volume) over (order by date) as c_staking_volume,
sum(unstaking_volume) over (order by date) as c_unstaking_volume,
c_staking_volume-c_unstaking_volume as net_flow
from
near.core.dim_staking_actions
group by date
Run a query to Download Data