SocioCryptofirst last
Updated 2022-12-11
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
SELECT
CASE WHEN try_parse_json(b.attribute_value):option = '1' then 'Yes'
WHEN try_parse_json(b.attribute_value):option = '2' then 'Abstain'
WHEN try_parse_json(b.attribute_value):option = '3' then 'No'
WHEN try_parse_json(b.attribute_value):option = '4' then 'No With Veto'
END as vote,
max(vote) over(partition by c.attribute_value ORDER BY a.block_timestamp) as l_voters,
min(vote) over(partition by c.attribute_value ORDER BY a.block_timestamp) as f_voters,
1 as n
FROM cosmos.core.fact_msg_attributes a, cosmos.core.fact_msg_attributes b, cosmos.core.fact_msg_attributes c
WHERE a.msg_type = 'proposal_vote' and b.msg_type = 'proposal_vote'
AND a.attribute_key = 'proposal_id' AND a.attribute_value = '82'
AND b.attribute_key = 'option'
AND a.tx_id = b.tx_id
AND a.tx_id = c.tx_id
AND c.msg_type = 'coin_spent' AND c.attribute_key = 'spender'
AND a.tx_succeeded = 'TRUE'
-- AND a.tx_id = 'CFAB67A96F28B60B5517B17A0B978B750B6384557A6AECB3DE4AAB95D5034B63'
having vote is not null
Run a query to Download Data