Chiefdistinct tokens faster
Updated 2023-05-30
999
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 events AS (
SELECT
tx_id
FROM
solana.core.fact_events
WHERE
program_id = 'E1XRkj9fPF2NQUdoq41AHPqwMDHykYfn5PzBXAyDs7Be'
-- AND block_timestamp >= current_date - 1
AND block_timestamp >= '2022-11-05'
AND succeeded
),
trades AS (
SELECT
mint.VALUE:mint::STRING AS mint,
mint.value:owner as owner
FROM
solana.core.fact_transactions t,
LATERAL FLATTEN(INPUT => t.pre_token_balances) mint
WHERE
-- block_timestamp >= current_date - 1
block_timestamp >= '2022-11-05'
AND tx_id IN (
SELECT
tx_id
FROM
events
)
)
-- mints as (
SELECT
distinct mint
FROM
trades
WHERE
owner = '6kLLewcYCvUK6xLQE1ep36ReamuTLFuTWwhCnbMCb3pd'
AND mint != 'So11111111111111111111111111111111111111112'
Run a query to Download Data