misaghlbFLOW's Path To Decentralization - net stake
Updated 2022-11-12Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
›
⌄
select
date_trunc('week', block_timestamp) as date,
sum(case when action in ('DelegatorTokensCommitted','TokensCommitted') then amount end) as staked_amount,
sum(case when action in ('DelegatorUnstakedTokensWithdrawn','UnstakedTokensWithdrawn') then amount end) as unstaked_amount,
sum(case when action in ('DelegatorTokensCommitted','TokensCommitted') then amount when action in ('DelegatorUnstakedTokensWithdrawn','UnstakedTokensWithdrawn') then amount * -1 end) as net_staked,
sum(net_staked) over (order by date) as cumu_net_staked
from flow.core.ez_staking_actions
where tx_succeeded = 'TRUE'
and action in ('DelegatorTokensCommitted','TokensCommitted', 'DelegatorUnstakedTokensWithdrawn','UnstakedTokensWithdrawn')
group by date
Run a query to Download Data