m0rt3zaSushi Weekly active users - ETH vs. OP
Updated 2022-10-26Copy 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
28
29
30
31
32
33
34
35
36
›
⌄
WITH wau_eth as (
SELECT
ORIGIN_FROM_ADDRESS as user,
date_trunc('Week', block_timestamp) as week,
COUNT(DISTINCT tx_hash) as tx_count,
count(DISTINCT block_timestamp::date) as active_day
FROM ethereum.sushi.ez_swaps
WHERE block_timestamp > '2022-06-01'
GROUP BY 1,2
HAVING active_day > 3
), wau_op as (
SELECT
ORIGIN_FROM_ADDRESS as user,
date_trunc('Week', block_timestamp) as week,
COUNT(DISTINCT tx_hash) as tx_count,
count(DISTINCT block_timestamp::date) as active_day
FROM optimism.sushi.ez_swaps
WHERE block_timestamp > '2022-06-01'
GROUP BY 1,2
HAVING active_day > 3
), eth_count as (
SELECT count(DISTINCT origin_from_address) as total_count
FROM ethereum.sushi.ez_swaps
WHERE block_timestamp > '2022-06-01'
), op_count as (
SELECT count(DISTINCT origin_from_address) as total_count
FROM optimism.sushi.ez_swaps
WHERE block_timestamp > '2022-06-01'
)
SELECT
'Ethereum' as "Network",
COUNT(DISTINCT user) as wau_count,
sum(tx_count) as "Number of Transactions (By Active Users)",
(SELECT total_count FROM eth_count) as total_users,
(wau_count/total_users) * 100 as wau_ratio
FROM wau_eth
Run a query to Download Data