KaskoazulMonkeDAO - voters purchasing after vote
Updated 2022-04-05
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 PURCHASERS AS (
select block_timestamp as fecha,
purchaser,
sales_amount,
concat_ws('#', 'SMB', token_id) as NFT,
marketplace,
tx_id
from solana.dim_nft_metadata md
left join solana.fact_nft_sales sale
on md.mint = sale.mint
where contract_address = ('9uBX3ASjxWvNBAD1xjbVaKA74mWGZys3RGSF7DdeDD3F') --contract_name = ('Solana Monkey Business')
and program_id in ('J7RagMKwSD5zJSbRQZU56ypHUtux8LRDkUpAPSKH4WPp', 'M2mx93ekt1fmXSVkTrUL9xVFHkmME8HTUi5Cyc5aF7K')
and succeeded = 'TRUE'
order by 4, 1
),
VOTERS AS (
select block_timestamp as fecha,
signers[0] as voter,
case instructions[0]:data
when 'Yjf5DvKUCfa2bPkYz4AiWs' then 'YES'
when 'Yjf5DvKUCfa2Rh5YBEg7FM' then 'NO'
end as vote
--count(1) as n,
--sum(ARRAY_SIZE(inner_instructions)) AS total_votes
from solana.fact_transactions
where instructions[0]:accounts[6] = 'BD9XQhU1DXA9V4GLdgTq7xdQY5UBnShfq4caTSEL9Lr'
and succeeded = 'TRUE'
and instructions[0]:programId = 'Daovoteq2Y28gJyme6TNUXT9TxXrePiouFuHezkiozci'
--group by 1
),
VOTERS_THAT_PURCHASED as (
select VOTERS.voter,
PURCHASERS.tx_id,
Run a query to Download Data