MufasaCount of days to participate in governance stats
Updated 2023-01-24Copy 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
24
25
26
27
28
29
›
⌄
with final_data as (
select
-- count_of_days,
avg(count_of_days) as avg_count_of_days,
median(count_of_days) as med_count_of_days,
max(count_of_days) as max_count_of_days
from (
select
voter,
datediff('day', txns_minimum, votes_minimum) as count_of_days
from (select
voter,
min(block_timestamp) as votes_minimum
from terra.core.fact_governance_votes votes join
( select
tx_sender,
min(block_timestamp) as txns_minimum
from terra.core.fact_transactions
group by tx_sender) txns
on votes.voter = txns.tx_sender
group by voter) vote join (select
tx_sender,
min(block_timestamp) as txns_minimum
from terra.core.fact_transactions
group by tx_sender) txn on vote.voter = txn.tx_sender
)
-- group by count_of_days
)
select * from final_data
Run a query to Download Data