sarathUser behavior_reduxx3
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
›
⌄
WITH total AS (
SELECT date_trunc('day', block_timestamp) as date,
tx_hash as txs,
AMOUNT_IN_USD as amountInUSD,
amount_out_usd as amountoutUSD,
SYMBOL_IN as symbolIn,
SYMBOL_OUT as symbolOut
FROM ETHEREUM.SUSHI.EZ_SWAPS
),
summary AS (
SELECT date,
count(txs) as dailyTXS,
SUM(amountInUSD) + SUM(amountoutusd) as dailyVolume
FROM total
GROUP BY date
ORDER BY date ASC
)
SELECT SUM(dailyVolume) as totalVolume, SUM(dailyVolume) / COUNT(date) as averageVolume_perDay
FROM summary
Run a query to Download Data