mhm🍣 Sushiswap - Swaps
Updated 2022-10-17Copy 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 optimism as (
select
date_trunc('day', block_timestamp) as day,
'Optimism' as network,
count(distinct tx_hash) as swap_count,
count(distinct origin_from_address) as swapper_count,
sum(amount_in_usd) as swap_volume,
avg(amount_in_usd) as avg_swap_volume,
sum(swap_volume) over (order by day) as cum_swap_volume,
sum(swap_count) over (order by day) as cum_swap_count,
sum(swapper_count) over (order by day) as cum_swapper_count
from optimism.sushi.ez_swaps
where day between '2022-07-01' and CURRENT_DATE - 1
group by 1,2
), arbitrum as (
select
date_trunc('day', block_timestamp) as day,
'Arbitrum' as network,
count(distinct tx_hash) as swap_count,
count(distinct origin_from_address) as swapper_count,
sum(amount_in_usd) as swap_volume,
avg(amount_in_usd) as avg_swap_volume,
sum(swap_volume) over (order by day) as cum_swap_volume,
sum(swap_count) over (order by day) as cum_swap_count,
sum(swapper_count) over (order by day) as cum_swapper_count
from arbitrum.sushi.ez_swaps
where day between '2022-07-01' and CURRENT_DATE - 1
group by 1,2
), polygon as (
select
date_trunc('day', block_timestamp) as day,
'Polygon' as network,
count(distinct tx_hash) as swap_count,
count(distinct origin_from_address) as swapper_count,
sum(amount_in_usd) as swap_volume,
avg(amount_in_usd) as avg_swap_volume,
Run a query to Download Data