Updated 2024-11-07
999
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 userActiveMonths AS (
SELECT
recipient AS wallet_addresses,
date_trunc('month', min(block_timestamp) :: date) AS start_month,
LISTAGG(
DISTINCT date_trunc('month', block_timestamp) :: date,
','
) AS active_months_list
FROM
ethereum.uniswapv3.ez_swaps
WHERE
block_timestamp >= '2024-06-01'
AND block_timestamp < '2024-10-01'
GROUP BY
wallet_addresses
),
splitActiveMonths AS (
SELECT
wallet_addresses,
value :: date AS active_month
FROM
userActiveMonths,
TABLE(SPLIT_TO_TABLE(active_months_list, ','))
),
monthlyRetention AS (
SELECT
to_char(start_month, 'Mon') AS month,
COUNT(start_month) AS new_users,
COUNT(
CASE
WHEN EXISTS (
SELECT
1
FROM
splitActiveMonths
WHERE
QueryRunArchived: QueryRun has been archived