jackguyNFT Collections Elixir by Sales Activty
Updated 2023-05-28
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 tab1 as (
--buy/sell event_table
-- buy events
SELECT
*,
INNER_instruction['instructions'][13]['parsed'],
INNER_instruction['instructions'][13]['parsed']['info']['mint'] as token_mint,
INNER_instruction['instructions'][13]['parsed']['info']['source'] as user,
'Sell' as event_type2
FROM solana.core.fact_events
LEFT outer JOIN solana.core.dim_labels
on address = INNER_instruction['instructions'][13]['parsed']['info']['mint']
WHERE block_timestamp > current_date - 90
AND INNER_instruction['instructions'][13]['program'] = 'spl-associated-token-account'
AND INNER_instruction['instructions'][13]['parsed']['type'] = 'create'
AND program_id LIKE 'E1XRkj9fPF2NQUdoq41AHPqwMDHykYfn5PzBXAyDs7Be'
UNION
-- sell events
SELECT
*,
INNER_instruction['instructions'][5]['parsed'],
INNER_instruction['instructions'][5]['parsed']['info']['mint'] as token_mint,
INNER_instruction['instructions'][5]['parsed']['info']['source'] as user,
'Buy' as event_type2
FROM solana.core.fact_events
LEFT outer JOIN solana.core.dim_labels
on address = INNER_instruction['instructions'][5]['parsed']['info']['mint']
WHERE INNER_instruction['instructions'][5]['program'] = 'spl-associated-token-account'
AND INNER_instruction['instructions'][5]['parsed']['type'] = 'create'
AND program_id LIKE 'E1XRkj9fPF2NQUdoq41AHPqwMDHykYfn5PzBXAyDs7Be'
AND block_timestamp > current_date - 90
)
Run a query to Download Data