hessCirculating Supply
Updated 2023-04-21Copy 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 flow as ( select date(block_timestamp) as date,action,node_id, tx_id, delegator , amount
from flow.core.ez_staking_actions
where tx_succeeded = 'TRUE')
,
final as ( select case when action in ('TokensCommitted','DelegatorTokensCommitted') then 'Stake'
when action in ('DelegatorUnstakedTokensWithdrawn','UnstakedTokensWithdrawn') then 'Unstake'
when action in ('RewardTokensWithdrawn','DelegatorRewardTokensWithdrawn') then 'Rewards' end as type, count(DISTINCT(tx_id)) as total_tx, count(DISTINCT(delegator)) as total_user,
sum(amount) as total_flow
from flow
group by 1)
,
stake as ( select total_flow as stake_volume
from final
where type = 'Stake'
)
,
unstake as ( select total_flow as unstake_volume
from final
where type = 'Unstake'
)
select '1036200000'::number as circulate, stake_volume, unstake_volume , stake_volume-unstake_volume as net , (net/circulate)*100 as ratio
from stake, unstake
Run a query to Download Data