rackhaelFLOW's Staking overtime
Updated 2023-04-17
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
›
⌄
SELECT date_trunc (week,block_timestamp) AS date,
CASE WHEN action in ('DelegatorTokensCommitted','TokensCommitted') THEN 'Stake'
WHEN action in ('DelegatorUnstakedTokensWithdrawn','UnstakedTokensWithdrawn') THEN 'Unstake'
WHEN action in ('DelegatorRewardTokensWithdrawn','RewardTokensWithdrawn') THEN 'Claim Reward' END AS event_action,
count(distinct tx_id) AS TT_txns,
count(distinct delegator) AS TT_users,
count(distinct node_id) AS TT_Nodes,
sum(amount) AS TT_Volume,
avg(amount) AS Avg_Volume,
median(amount) AS Med_Volume,
sum (TT_txns) over (partition by event_action order by date) AS Cumulative_Txns,
sum (TT_Volume) over (partition by event_action order by date) AS Cumulative_Volume
FROM flow.core.ez_staking_actions
WHERE tx_succeeded = 'TRUE'
GROUP BY 1,2
Run a query to Download Data