elsinaSushi Swap Daily Info
Updated 2022-10-16
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
›
⌄
with arbi_swapper as (
select BLOCK_TIMESTAMP::date as "Day",tx_hash ,ORIGIN_FROM_ADDRESS as "Swapper",'Arbitrum' as "Layer Name" from arbitrum.sushi.ez_swaps where block_timestamp >= '2022-05-01'
),
op_swapper as (
select BLOCK_TIMESTAMP::date as "Day",tx_hash ,ORIGIN_FROM_ADDRESS as "Swapper",'Optimism' as "Layer Name" from optimism.sushi.ez_swaps where block_timestamp >= '2022-05-01'
),
poly_swapper as (
select BLOCK_TIMESTAMP::date as "Day",tx_hash ,ORIGIN_FROM_ADDRESS as "Swapper",'Polygon' as "Layer Name" from polygon.sushi.ez_swaps where block_timestamp >= '2022-05-01'
), all_uni_swaps as (
select * from arbi_swapper
union all
select * from op_swapper
union all
select * from poly_swapper
)
select
"Day",
count(distinct tx_hash) as "Daily Number of Swaps",
count(DISTINCT "Swapper") as "Number of Unique Swapper",
count(distinct (case when 'Optimism'="Layer Name" then "Swapper" end)) as "Unique Optimism Swapper",
count(distinct (case when 'Arbitrum'="Layer Name" then "Swapper" end)) as "Unique Arbitrum Swapper",
count(distinct (case when 'Polygon'="Layer Name" then "Swapper" end)) as "Unique Polygon Swapper",
count(distinct (case when 'Optimism'="Layer Name" then tx_hash end)) as "Optimism Swap Count",
count(distinct (case when 'Arbitrum'="Layer Name" then tx_hash end)) as "Arbitrum Swap Count",
count(distinct (case when 'Polygon'="Layer Name" then tx_hash end)) as "Polygon Swap Count",
sum("Daily Number of Swaps") over (order by "Day") as "Cumulative Swap Count",
sum("Optimism Swap Count") over (order by "Day") as "Cumulative Optimism Swap Count",
sum("Arbitrum Swap Count") over (order by "Day") as "Cumulative Arbitrum Swap Count",
sum("Polygon Swap Count") over (order by "Day") as "Cumulative Polygon Swap Count"
from all_uni_swaps
group by "Day"
order by "Day"
Run a query to Download Data