rajsDaily Votes
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
›
⌄
with latest_proposals as
(
SELECT
proposal_id,
count(*) as no_of_votes,
count(distinct voter) as no_of_voters,
min(block_timestamp),
max(block_timestamp)
from terra.core.fact_governance_votes
where tx_succeeded
group by 1
order by 5 desc
limit 5
)
SELECT
date_trunc('day', block_timestamp) as date,
proposal_id::text as proposal_id,
vote_option_text,
count(distinct tx_id) as no_of_votes,
count(distinct voter) as no_of_voters
from terra.core.fact_governance_votes
where proposal_id in (select proposal_id from latest_proposals)
group by 1,2,3
order by 1
Run a query to Download Data