Afonso_DiazUntitled Query
Updated 2023-01-23
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
›
⌄
with t as (
select
voter,
min(block_timestamp)::date as min_date
from terra.core.fact_governance_votes
where tx_succeeded = 1
group by 1
),
t2 as (
select
proposal_id,
min(block_timestamp)::date as min_date
from terra.core.fact_governance_votes
where tx_succeeded = 1
group by 1
)
select
count(distinct tx_id) as votes_count,
count(distinct t2.proposal_id) as new_proposals_count,
count(distinct a.proposal_id) as active_proposals_count,
count(distinct t.voter) as new_voters_count,
count(distinct a.voter) as voters_count
from terra.core.fact_governance_votes a
left join t on a.block_timestamp::date = t.min_date
left join t2 on a.block_timestamp::date = t2.min_date
where a.block_timestamp > current_date - interval '1 month'
Run a query to Download Data