StangFAST07.01 - types of active days
Updated 2023-05-11
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
›
⌄
-- forked from 07 - types of active days @ https://flipsidecrypto.xyz/edit/queries/7cb0cd86-2817-40e2-8dbb-e19654087892
with
NEAR_users AS
(
SELECT
min( a.block_timestamp ) AS min_date
, a.trader AS users
FROM
near.core.ez_dex_swaps a
GROUP BY
2
)
,
active AS
(
SELECT
a.trader AS users
, count( DISTINCT date_trunc( 'day' , a.block_timestamp ) ) AS active_days
FROM
near.core.ez_dex_swaps a
JOIN
NEAR_users b
ON a.trader = b.users
GROUP BY
1
)
SELECT
date_trunc( 'week' , b.block_timestamp ) AS date
, count( DISTINCT( users ) ) AS users
, CASE
when active_days = 1 then 'a : 1 day'
Run a query to Download Data