rackhaelGOOVERNANCE ON FLOW
Updated 2024-07-12
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
28
29
30
31
32
33
34
35
36
›
⌄
SELECT date_trunc('week', a.block_timestamp) as date, --distinct action,
count(a.tx_id) as tt_actions,
count(distinct a.delegator) as tt_delegators,
sum(a.amount) as flow_staked,
case when a.action = 'TokensCommitted' then 'TokensCommitted'
when a.action = 'DelegatorRewardTokensWithdrawn' then 'DelegatorRewardTokensWithdrawn'
when a.action = 'DelegatorUnstakedTokensWithdrawn' then 'DelegatorUnstakedTokensWithdrawn'
when a.action = 'UnstakedTokensWithdrawn' then 'UnstakedTokensWithdrawn'
when a.action = 'DelegatorTokensCommitted' then 'DelegatorTokensCommitted'
when a.action = 'RewardTokensWithdrawn' then 'RewardTokensWithdrawn'
end as action_type,
l.validator_type as validator_type,
l.project_name as validator,
count(distinct project_name) as n_validators
FROM flow.gov.ez_staking_actions a JOIN
flow.gov.dim_validator_labels l ON a.node_id = l.node_id
WHERE block_timestamp :: date >= '2024-01-01'
AND tx_succeeded = 'true'
GROUP BY 1, 5, 6, 7
ORDER BY 1
-- SELECT
-- date,
-- action_type,
-- tt_actions,
-- tt_delegators,
-- flow_staked,
-- SUM(tt_actions) OVER (PARTITION BY action_type ORDER BY date) AS cumulative_actions,
-- SUM(tt_delegators) OVER (PARTITION BY action_type ORDER BY date) AS cumulative_delegators,
-- SUM(flow_staked) OVER (PARTITION BY action_type ORDER BY date) AS cumulative_flow_staked
-- FROM
-- base
-- ORDER BY
-- date;
QueryRunArchived: QueryRun has been archived