ben-wyatterc20-and-native-token-transfers
Updated 2025-02-03
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
›
⌄
SELECT
DATE_TRUNC('month', block_timestamp) AS rounded_month,
COUNT(DISTINCT from_address) AS unique_users,
SUM(amount_usd) AS tx_vol_usd,
COUNT(*) AS tx_count,
CASE
WHEN amount_usd > 100000 THEN 'Large'
ELSE 'Small'
END AS transaction_size
FROM (
SELECT
block_timestamp,
from_address,
amount_usd
FROM avalanche.core.ez_token_transfers
WHERE block_timestamp BETWEEN '2022-01-01' AND '2024-12-31'
UNION ALL
SELECT
block_timestamp,
from_address,
amount_usd,
FROM avalanche.core.ez_native_transfers
WHERE block_timestamp BETWEEN '2022-01-01' AND '2024-12-31'
) AS combined_transfers
--where amount_usd < 1e9
GROUP BY
rounded_month,
transaction_size
ORDER BY
rounded_month,
transaction_size;
QueryRunArchived: QueryRun has been archived