Moe11 op por
Updated 2022-11-07Copy 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 base as (
select
block_timestamp,
tx_hash,
event_name as event
from
optimism.core.fact_event_logs
where tx_status = 'SUCCESS'
and contract_address = '0x4200000000000000000000000000000000000042' --OP
union all
select
block_timestamp,
tx_hash,
label_type as event
from
optimism.core.fact_event_logs l,optimism.core.dim_labels b
where tx_status = 'SUCCESS'
and origin_to_address = address
and contract_address = '0x4200000000000000000000000000000000000042'
)
select
date_trunc(week,block_timestamp)::date as weeks,
case
when EVENT ilike '%swap%' or EVENT ilike '%dex%' then 'swap activities'
when EVENT ilike 'stak%' then 'stake activities'
when EVENT ilike '%unstak%' then 'un-stake activities'
when EVENT ilike '%liquidity%' or EVENT ilike '%farm%' then 'Farming activities'
when EVENT ilike '%nft%' then 'NFT activities'
when EVENT ilike '%layer2%' then 'Bridging activities'
else 'other activities'
Run a query to Download Data