adriaparcerisasOptimism DEXs (redux) 7
Updated 2022-10-26
999
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
›
⌄
--Total number of swaps by day over the last month
--Total number of wallets swapping by day
--What are the most popular asset pairs to swap from and too
--Top 10 assets swapping from
--Top 10 assets to swap to
with
pools as (
SELECT
distinct symbol_in as token_1,
token_address_in as token_1_address,
symbol_out as token_2,
token_address_out as token_2_address
from optimism.velodrome.ez_swaps
),
uniswap as (
select
'Uniswap' as project_name,
token_2,
count(DISTINCT tx_hash) as swaps,
count (distinct origin_from_address) as swappers
from optimism.core.fact_event_logs x
join pools on contract_address = token_2_address
where event_name like '%Transfer%' and origin_from_address = event_inputs:from and origin_to_address in('0xe592427a0aece92de3edee1f18e0157c05861564','0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45') and block_timestamp>CURRENT_DATE-INTERVAL'1 month'
GROUP by 1,2
order by 1 asc
),
sushiswap as (
select
'Suhiswap' as project_name,
symbol_in as token_2,
count(DISTINCT tx_hash) as swaps,
count (distinct origin_from_address) as swappers
from optimism.sushi.ez_swaps
where block_timestamp>CURRENT_DATE-INTERVAL'1 month'
GROUP by 1,2
Run a query to Download Data