farid-c9j0VMtransaction
Updated 2022-12-23Copy 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
›
⌄
with optimism_transactions as (
select
block_timestamp,
tx_hash,
origin_from_address
from optimism.core.fact_event_logs
where tx_status = 'SUCCESS'
and block_timestamp::date >= '2022-11-01'
),
transactions_results as (
select
date_trunc('day', block_timestamp) as date,
count(distinct tx_hash) as "Number of Transactions",
count(distinct origin_from_address) as "Daily Active User"
from optimism_transactions
group by 1
),
op_token_price as (
select
hour::date as date,
avg(price) as "OP Price"
from optimism.core.fact_hourly_token_prices
where hour::date >= '2022-11-01'
and token_address = '0x4200000000000000000000000000000000000042'
group by 1
)
select
transactions.*, case
when date between '2022-11-06' and '2022-11-09' then 'Op price drop' else 'Other days' end as type,
op_price."OP Price" as "OP Price"
from transactions_results transactions
join op_token_price op_price using(date)
Run a query to Download Data