0xHaM-dSushi
Updated 2022-10-15Copy 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
›
⌄
select
date_trunc('{{Interval}}', block_timestamp)::date as date,
'Sushi on Optimism' as dex,
count(distinct tx_hash) as swap_count,
count(distinct origin_from_address) as unique_swappers,
sum(swap_count) over (order by date asc) as cum_swap_count,
sum(unique_swappers) over (order by date asc) as cum_unique_swapper
from optimism.sushi.ez_swaps
where block_timestamp::date >= CURRENT_DATE - {{n_day}}
group by 1
UNION ALL
select
date_trunc('{{Interval}}', block_timestamp)::date as date,
'Sushi on Arbitrum' as dex,
count(distinct tx_hash) as swap_count,
count(distinct origin_from_address) as unique_swappers,
sum(swap_count) over (order by date asc) as cum_swap_count,
sum(unique_swappers) over (order by date asc) as cum_unique_swapper
from arbitrum.sushi.ez_swaps
where block_timestamp::date >= CURRENT_DATE - {{n_day}}
group by 1
UNION ALL
select
date_trunc('{{Interval}}', block_timestamp)::date as date,
'Sushi on Polygon' as dex,
count(distinct tx_hash) as swap_count,
count(distinct origin_from_address) as unique_swappers,
sum(swap_count) over (order by date asc) as cum_swap_count,
sum(unique_swappers) over (order by date asc) as cum_unique_swapper
from polygon.sushi.ez_swaps
where block_timestamp::date >= CURRENT_DATE - {{n_day}}
group by 1
Run a query to Download Data