piper2024-03-31 09:05 AM
Updated 2024-03-31
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 jup_set_vote AS (
SELECT
block_timestamp,
tx_id,
signers[0] AS signers,
DECODED_INSTRUCTION,
DECODED_INSTRUCTION['accounts'][0]['pubkey'] AS governor,
DECODED_INSTRUCTION['accounts'][1]['pubkey'] AS proposal,
DECODED_INSTRUCTION['accounts'][2]['pubkey'] AS vote,
DECODED_INSTRUCTION['accounts'][3]['pubkey'] AS locker,
DECODED_INSTRUCTION['args']['side'] AS side,
DECODED_INSTRUCTION['args']['weight'] / POW(10, 6) AS weight,
ROW_NUMBER() OVER (PARTITION BY vote ORDER BY block_timestamp DESC) AS rn
FROM
solana.core.ez_events_decoded
WHERE
program_id = 'GovaE4iu227srtG2s3tZzB4RmWBzw8sTwrCLZz7kN7rY'
AND event_type = 'setVote'
AND block_timestamp >= '2024-03-29'
and block_timestamp <= '2024-04-02'
),
latest_votes AS (
SELECT
block_timestamp,
tx_id,
signers,
DECODED_INSTRUCTION,
governor,
proposal,
vote,
locker,
side,
weight
FROM
jup_set_vote
WHERE
QueryRunArchived: QueryRun has been archived