KaskoazulxGOV Votes
Updated 2022-03-11
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
29
30
31
32
33
34
35
36
›
⌄
WITH xGOV_VOTES AS (
SELECT
block_timestamp::date as fecha,
tx_id,
sender,
tx_message:rs,
try_base64_decode_string(tx_message:txn:note::string) as note,
CASE
WHEN note like 'af/gov1:j[_,_a_]' then 'A'
WHEN note like 'af/gov1:j[_,_b_]' then 'B'
END AS VOTE
FROM
algorand.transactions
WHERE
fecha between '2022-01-31 16:59:00' and '2022-02-28'
AND try_base64_decode_string(tx_message:txn:note::string) like 'af/gov1:j%'
),
LATEST_VOTES AS (
SELECT
max(fecha) as latest_vote,
sender,
tx_id,
VOTE
FROM xGOV_VOTES
GROUP BY 2,3,4
)
SELECT
latest_vote,
count(sender),
Vote
FROM LATEST_VOTES
GROUP BY 1,3
ORDER BY 3
Run a query to Download Data