adriaparcerisasOptimism DEX swaps 2
Updated 2022-08-03
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
uniswap as (
select
trunc(block_timestamp,'day') as date,
project_name,
contract_address,
count(DISTINCT tx_hash) as swaps
from optimism.core.fact_event_logs x
join optimism.core.dim_labels on origin_to_address = address
where label_type = 'dex' and project_name='uniswap' and block_timestamp>CURRENT_DATE-INTERVAL'1 month'
GROUP by 1,2,3
order by 1 asc
),
velodrome as (
select
trunc(block_timestamp,'day') as date,
'Velodrome Finance' as project_name,
contract_address,
count(DISTINCT tx_hash) as swaps
from optimism.core.fact_event_logs
where origin_to_address='0xa132dab612db5cb9fc9ac426a0cc215a3423f9c9' and block_timestamp>CURRENT_DATE-INTERVAL'1 month'
GROUP by 1,2,3
order by 1 asc
),
final as (
select * from velodrome
union select * from uniswap
)
SELECT
date,
project_name,
symbol as token,
swaps
from final x
join optimism.core.dim_contracts y on contract_address=address
order by 1 asc
Run a query to Download Data