Tony_Intel4 - users per inactive month
Updated 2023-09-18
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 source as (
select distinct
trader,
date_trunc('month', block_timestamp) as month
from crosschain.defi.ez_dex_swaps
where
platform ilike '%uniswap%' and
blockchain in ('ethereum', 'optimism', 'arbitrum', 'polygon') and
amount_in_usd <= 15000000 and
amount_out_usd <= 15000000 and
block_timestamp::date >= '2022-01-01'
),
before_2206 as (
select distinct
trader,
date_trunc('month', ('2022-05-25'/*A random date which is before 2022/06/01 */::date)) as month
from (
select distinct trader
from source
where
month::date < '2022-06-01'
)
),
after_2206 as (
select distinct
x.trader,
(DATEDIFF(month, x.date, '2023-09-01'::DATE) + 1) as month_number
from source c
join (
select distinct
trader,
rank() over (partition by trader order by month) as rank,
month as date
from source
where
month::date >= '2022-06-01' and
Run a query to Download Data