cristinatintocosmos redelegations
Updated 2022-12-14
999
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
›
⌄
with
tab1 as (
select tx_id,attribute_value as proposal_id
from cosmos.core.fact_msg_attributes
where msg_type='proposal_vote' and attribute_key='proposal_id' and tx_succeeded = 'TRUE' and attribute_value=82
),
tab2 as (
select block_timestamp,
tx_id,
attribute_value as wallet
from cosmos.core.fact_msg_attributes
where ATTRIBUTE_KEY= 'spender' and tx_id in (select tx_id from tab1)
),
tab3 as (
select block_timestamp,
tx_id,
82 proposal,
case when attribute_value='VOTE_OPTION_YES' or attribute_value like '%{"option":1%' then 'Yes'
when attribute_value='VOTE_OPTION_NO' or attribute_value like '%{"option":3%' then 'No'
when attribute_value='VOTE_OPTION_NO_WITH_VETO' or attribute_value like '%{"option":4%' then 'No with veto'
else 'Abstain' end as vote_option
from cosmos.core.fact_msg_attributes
where ATTRIBUTE_KEY= 'option' and tx_id in (select tx_id from tab1)
having vote_option is not null
),
tab4 as (
select y.block_timestamp,
x.tx_id,
wallet,
vote_option,
proposal
from tab1 x join tab2 y on x.tx_id = y.tx_id
join tab3 z on x.tx_id = z.tx_id
),
tab5 as (
Run a query to Download Data