SocioCryptoProposals overview
Updated 2022-12-22Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
›
⌄
SELECT a.attribute_value as proposal_id,
CASE WHEN proposal_id = '{{proposal_id}}' THEN 'A' ELSE 'B' END as prop,
COUNT (DISTINCT a.tx_id) as n_votes,
count(DISTINCT c.attribute_value) as n_participants
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 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'
GROUP BY proposal_id
ORDER BY proposal_id
Run a query to Download Data