jackguyGovernance Reaction to Terra
Updated 2022-05-22
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 id as (
select block_timestamp::date as date,
attribute_value as proposal,
row_number() over(partition by proposal order by date) as day,
tx_id
from osmosis.core.fact_msg_attributes
where msg_type = 'proposal_vote' and attribute_key = 'proposal_id'
and attribute_value between 222 and 227
),
vote as (
select tx_id,
count(try_parse_json(attribute_value):option) as votes
from osmosis.core.fact_msg_attributes
where msg_type = 'proposal_vote' and attribute_key = 'option'
group by 1
)
select
date,
proposal,
sum(VOTES),
count(*)
from id
join vote
on id.tx_id = vote.tx_id
where date > CURRENT_DATE - 14
GROUP BY 1,2
Run a query to Download Data