Query editor
-- WITH original_token_allocations AS (-- -- Gets all the accounts which existed between 10am and 11am UTC (confirmed no balance owners before 10am)-- SELECT-- token_balance_owner-- FROM solana.account_activity-- WHERE token_mint_address = 'simd96Cuw3M5TYAkZ1d71ug4bvVHiqHhhJzsFHHQxgq'-- AND block_time >= CAST('2024-05-17 00:00:00' AS TIMESTAMP)-- AND block_time <= CAST('2024-05-31 23:00:00' AS TIMESTAMP)-- AND post_token_balance > 0-- AND token_balance_owner NOT IN(-- '8fju7G8LK9WsqZGr3VFcA2XoXSnNqMmoQB8MBL5Ebx6b' -- Merkle Distributor-- )-- GROUP BY 1--),WITH transactions_with_vote_token_past_creation_time AS (SELECT*FROM solana.transactionsWHERE block_time >= CAST('2024-05-17 00:00:00' AS TIMESTAMP)AND block_time <= CAST('2024-05-31 23:00:00' AS TIMESTAMP)AND CONTAINS(account_keys, 'simd96Cuw3M5TYAkZ1d71ug4bvVHiqHhhJzsFHHQxgq')), transactions_wo_priority AS (SELECT *FROM transactions_with_vote_token_past_creation_timeWHERE cardinality(instructions) = 1), transactions_w_priority_first AS (SELECT *FROM transactions_with_vote_token_past_creation_timeWHERE cardinality(instructions) > 1AND instructions[1][2] = 'ComputeBudget111111111111111111111111111111'), agg_wo_priority AS (-- YES YESsimd96Cuw3M5TYAkZ1d71ug4bvVHiqHhhJzsFHHQ TOKEN ACCOUNT FOR 7CrAvWEASABRgakuK9M8DkTK7wJieMurf59eWaFzX7P9-- NO nosimd96Cuw3M5TYAkZ1d71ug4bvVHiqHhhJzssFHHQ TOKEN ACCOUNT FOR 5BE5U1eZfoeWTerBp9mBBqE2WHnscdWey4sceEM1ojRu-- ABSTAIN ABSTA1Nsimd96Cuw3M5TYAkZ1d71ug4bvVHiqHhhJzs TOKEN ACCOUNT FOR ARjw39v3Y6QWK7WaWdTEKqiFDym1S2gTmXykbWRDFUx4-- instructions[1][3][3] destination account-- instructions[1][3][4] identity account-- post_token_balances[2][4], -- Identity Account Balance Post TxnSELECTinstructions[1][3][4] AS identity_account, -- Identity AccountCASEWHEN pre_token_balances[2][3] = instructions[1][3][4]THEN TRY(pre_token_balances[2][4])ELSE TRY(pre_token_balances[1][4])END AS pre_balance,CASEWHEN post_token_balances[2][3] = instructions[1][3][4]THEN TRY(post_token_balances[2][4])ELSE TRY(post_token_balances[1][4])END AS post_balance,CASEWHEN instructions[1][3][3] = 'YESsimd96Cuw3M5TYAkZ1d71ug4bvVHiqHhhJzsFHHQ'THEN 'Yes'WHEN instructions[1][3][3] = 'nosimd96Cuw3M5TYAkZ1d71ug4bvVHiqHhhJzssFHHQ'THEN 'No'WHEN instructions[1][3][3] = 'ABSTA1Nsimd96Cuw3M5TYAkZ1d71ug4bvVHiqHhhJzs'THEN 'Abstain'ELSE NULLEND AS action_taken,block_time AS time_of_transaction,signature,