0xallyzacharb users
Updated 2023-06-15Copy Reference Fork
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
›
⌄
SELECT chain, transaction_date, SUM(distinct_from_addresses) AS total_distinct_from_addresses
FROM (
SELECT 'arbitrum' AS chain, DATE_TRUNC('week', TO_TIMESTAMP(block_timestamp)) AS transaction_date,
COUNT(DISTINCT from_address) AS distinct_from_addresses
FROM arbitrum.core.fact_transactions
WHERE TO_TIMESTAMP(block_timestamp) >= '2022-01-01'
GROUP BY transaction_date
UNION ALL
SELECT 'optimism' AS chain, DATE_TRUNC('week', TO_TIMESTAMP(block_timestamp)) AS transaction_date,
COUNT(DISTINCT from_address) AS distinct_from_addresses
FROM optimism.core.fact_transactions
WHERE TO_TIMESTAMP(block_timestamp) >= '2022-01-01'
GROUP BY transaction_date
UNION ALL
SELECT 'ethereum' AS chain, DATE_TRUNC('week', TO_TIMESTAMP(block_timestamp)) AS transaction_date,
COUNT(DISTINCT from_address) AS distinct_from_addresses
FROM ethereum.core.fact_transactions
WHERE TO_TIMESTAMP(block_timestamp) >= '2022-01-01'
GROUP BY transaction_date
) subquery
GROUP BY chain, transaction_date
ORDER BY transaction_date;
Run a query to Download Data