algo_ahab-4V8aSZsol_top_traders copy
Updated 2024-07-26
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
›
⌄
WITH selected_addresses AS (
SELECT '0xaa0e58adb8d1ea1964d0b65c9e83ea84c80a3459' AS address
UNION ALL
SELECT '0xcfb5daf7f7b3ce2c4f8c22bcd1d7c764aca63b41'
)
SELECT
ft.BLOCK_TIMESTAMP,
ft.TX_ID,
ft.TX_FROM,
ft.TX_TO,
ft.AMOUNT,
ft.MINT,
from_labels.LABEL_TYPE AS FROM_LABEL_TYPE,
from_labels.LABEL_SUBTYPE AS FROM_LABEL_SUBTYPE,
from_labels.LABEL AS FROM_LABEL,
to_labels.LABEL_TYPE AS TO_LABEL_TYPE,
to_labels.LABEL_SUBTYPE AS TO_LABEL_SUBTYPE,
to_labels.LABEL AS TO_LABEL,
asset_metadata.SYMBOL AS TOKEN_SYMBOL,
asset_metadata.NAME AS TOKEN_NAME
FROM
solana.core.fact_transfers AS ft
LEFT JOIN solana.core.dim_labels AS from_labels ON ft.TX_FROM = from_labels.ADDRESS
LEFT JOIN solana.core.dim_labels AS to_labels ON ft.TX_TO = to_labels.ADDRESS
LEFT JOIN solana.price.ez_asset_metadata AS asset_metadata ON ft.MINT = asset_metadata.TOKEN_ADDRESS
JOIN selected_addresses AS sa ON ft.TX_FROM = sa.address OR ft.TX_TO = sa.address
WHERE
ft.BLOCK_TIMESTAMP >= CURRENT_DATE - INTERVAL '3 days'
ORDER BY
ft.BLOCK_TIMESTAMP DESC;
QueryRunArchived: QueryRun has been archived