MLDZMNavp7
Updated 2022-11-09
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 tb1 as (SELECT
SYMBOL_IN,
count(distinct tx_hash) as swap_no,
count(distinct ORIGIN_FROM_ADDRESS) as swappers,
sum(AMOUNT_IN_USD) as volume,
volume/swap_no as average_volume
FROM optimism.velodrome.ez_swaps where SYMBOL_OUT='OP'
group by 1 having volume is not null
union all
SELECT
SYMBOL_IN,
count(distinct tx_hash) as swap_no,
count(distinct ORIGIN_FROM_ADDRESS) as swappers,
sum(AMOUNT_IN_USD) as volume,
volume/swap_no as average_volume
FROM optimism.sushi.ez_swaps where SYMBOL_OUT='OP'
group by 1 having volume is not null
order by 4 desc limit 10)
SELECT
date_trunc('week',BLOCK_TIMESTAMP) as week,
SYMBOL_IN,
count(distinct tx_hash) as swap_no,
count(distinct ORIGIN_FROM_ADDRESS) as swappers,
sum(AMOUNT_IN_USD) as volume,
volume/swap_no as average_volume
FROM optimism.velodrome.ez_swaps where SYMBOL_OUT='OP'
and SYMBOL_IN in (select SYMBOL_IN from tb1)
group by 1,2 having volume is not null
union all
SELECT
date_trunc('week',BLOCK_TIMESTAMP) as week,
SYMBOL_IN,
count(distinct tx_hash) as swap_no,
count(distinct ORIGIN_FROM_ADDRESS) as swappers,
sum(AMOUNT_IN_USD) as volume,
Run a query to Download Data