KowalskiDeFi[Optimism]: Token Flow
Updated 2023-03-20
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
›
⌄
With l1 as (
SELECT
DATE_TRUNC('hour',block_timestamp) as date_time,
COUNT(distinct tx_hash) as number_transactions_l1,
SUM(tx_fee) as txn_fees_l1
FROM ethereum.core.fact_transactions as txns
WHERE tx_hash IN
(
SELECT
l1_state_root_tx_hash
FROM optimism.core.fact_l1_state_root_submissions
)
GROUP BY 1
),
l2 as (
SELECT
DATE_TRUNC('hour',block_timestamp) as date_time,
COUNT(distinct tx_hash) as number_transactions_l2,
COUNT(distinct from_address) as unique_active_users_l2,
SUM(tx_fee) as txn_fees_l2
FROM optimism.core.fact_transactions
GROUP BY 1
)
SELECT
*
FROM l1
INNER JOIN l2 ON l1.date_time=l2.date_time
Run a query to Download Data