cyphernear net delegations
Updated 2023-04-13
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
›
⌄
with staked as (select
date_trunc('day', block_timestamp) as date,
sum(stake_amount/1e24) as delegations,
count(distinct(tx_signer)) as distinct_delegators
from near.core.dim_staking_actions
where action = 'Stake'
group by date
),
unstaked as (select
date_trunc('day', block_timestamp) as date,
sum(stake_amount/1e24) as undelegations,
count(distinct(tx_signer)) as distinct_undelegators
from near.core.dim_staking_actions
where action = 'Unstake'
group by date )
select
date(s.date) as date,
s.distinct_delegators,
u.distinct_undelegators,
s.distinct_delegators - u.distinct_undelegators as net_n_delegators,
s.delegations,
u.undelegations * (-1) as undelegations,
s.delegations - u.undelegations as net_delegations
from staked s, unstaked u
where s.date = u.date
Run a query to Download Data