datavortexweekly activities
Updated 2024-12-11
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
SELECT
DATE_TRUNC('WEEK', s.block_timestamp) AS "Week Start Date",
COUNT(DISTINCT s.tx_hash) AS "Total Swaps (All Traders)",
SUM(s.amount_in_usd) AS "Total Volume Swapped (All Traders USD)",
(SUM(s.amount_in_usd) / NULLIF(COUNT(DISTINCT s.tx_hash), 0)) AS "Average Swap Volume (All Traders USD)",
SUM(COUNT(DISTINCT s.tx_hash)) OVER (ORDER BY DATE_TRUNC('WEEK', s.block_timestamp)) AS "Cumulative Total Swaps",
SUM(SUM(s.amount_in_usd)) OVER (ORDER BY DATE_TRUNC('WEEK', s.block_timestamp)) AS "Cumulative Total Volume Swapped (All Traders USD)"
FROM
near.defi.ez_dex_swaps s
WHERE
s.block_timestamp >= '2024-01-01'
AND s.block_timestamp <= '2024-12-31'
GROUP BY
DATE_TRUNC('WEEK', s.block_timestamp)
ORDER BY
"Week Start Date" DESC;
QueryRunArchived: QueryRun has been archived