jackguysushi_l2_2 copy copy copy
Updated 2023-03-10
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
›
⌄
-- forked from 63410b29-3e4b-458f-8431-5930ec3f98de
-- forked from 3e538a2a-0e1f-4a25-9242-d256f9727575
-- forked from e491f158-d479-41ac-9d02-b33aedbec8ef
SELECT
avg(transaction),
avg(active_users),
avg(swap_volume_USD)
from (
SELECT
date_trunc('day', block_timestamp) as day,
count(DISTINCT tx_hash) as transaction,
count(DISTINCT ORIGIN_FROM_ADDRESS) as active_users,
sum(CASE when not amount_in_usd is NULL then AMOUNT_IN_USD
when not amount_out_usd is NULL then AMOUNT_OUT_USD
else 0 end) as swap_volume_USD
FROM gnosis.sushi.ez_swaps
GROUP BY 1
HAVING day > '2022-01-01'
--LIMIT 500
)
Run a query to Download Data