swiftbrainzdaily volume
Updated 2024-07-20
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
›
⌄
WITH daily_volumes AS (
SELECT
DATE_TRUNC('day', BLOCK_TIMESTAMP) AS day,
SUM(AMOUNT_IN_USD) AS daily_swap_volume
FROM
bsc.defi.ez_dex_swaps
WHERE
BLOCK_TIMESTAMP >= '2024-01-01' AND BLOCK_TIMESTAMP < '2025-01-01'
GROUP BY
DATE_TRUNC('day', BLOCK_TIMESTAMP)
)
SELECT
day,
daily_swap_volume,
SUM(daily_swap_volume) OVER (ORDER BY day ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING) AS cumulative_swap_volume
FROM
daily_volumes
ORDER BY
day;
QueryRunArchived: QueryRun has been archived