m0rt3zaSushiSwap on Optimism Total Stats
Updated 2022-10-25Copy 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 daily as (
SELECT block_timestamp::date as date,
COUNT(DISTINCT tx_hash) as swap_count,
COUNT(DISTINCT origin_from_address) as wallet_count,
sum(amount_in_usd) as total_usd_volume
FROM optimism.sushi.ez_swaps
WHERE block_timestamp > '2022-06-01'
GROUP BY 1
), weekly as (
SELECT date_trunc('Week', block_timestamp),
COUNT(DISTINCT tx_hash) as swap_count,
COUNT(DISTINCT origin_from_address) as wallet_count,
sum(amount_in_usd) as total_usd_volume
FROM optimism.sushi.ez_swaps
WHERE block_timestamp > '2022-06-01'
GROUP BY 1
), monthly as (
SELECT date_trunc('Month', block_timestamp),
COUNT(DISTINCT tx_hash) as swap_count,
COUNT(DISTINCT origin_from_address) as wallet_count,
sum(amount_in_usd) as total_usd_volume
FROM optimism.sushi.ez_swaps
WHERE block_timestamp > '2022-06-01'
GROUP BY 1
)
SELECT
'Daily' as time_period,
floor(avg(swap_count)) as swap_count,
floor(avg(wallet_count)) as wallet_count,
floor(avg(total_usd_volume)) as total_usd_volume
FROM daily
UNION ALL
SELECT
'Weekly' as time_period,
floor(avg(swap_count)) as swap_count,
floor(avg(wallet_count)) as wallet_count,
Run a query to Download Data