datavortextroubled-aquamarine
Updated 2024-10-31
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 MonthlyVolume AS (
SELECT
DATE_TRUNC('month', block_timestamp) AS month,
COUNT(DISTINCT trader) AS Swappers
FROM
flow.defi.ez_dex_swaps
GROUP BY
month
),
CumulativeSwappers AS (
SELECT
month,
Swappers,
SUM(Swappers) OVER (
ORDER BY
month
) AS CumulativeSwappers,
(
Swappers - LAG(Swappers) OVER (
ORDER BY
month
)
) * 100.0 / NULLIF(
LAG(Swappers) OVER (
ORDER BY
month
),
0
) AS SwapperChangePercentage
FROM
MonthlyVolume
)
SELECT
month,
Swappers,
CumulativeSwappers,
QueryRunArchived: QueryRun has been archived