rezarwznew and old user monthly
Updated 2023-05-16
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
›
⌄
with swap_users as(
SELECT
BLOCK_TIMESTAMP,
ORIGIN_FROM_ADDRESS as user_wallet_address,
'swapping' as EVENT_NAME,
AMOUNT_IN_USD,
AMOUNT_OUT_USD,
PLATFORM,
SYMBOL_IN,
SYMBOL_out,
RANK() OVER (partition by ORIGIN_FROM_ADDRESS order by BLOCK_TIMESTAMP asc)as rank
FROM ethereum.core.ez_dex_swaps
where platform in ('uniswap-v2','uniswap-v3'))
SELECT
date_trunc('month',block_timestamp) as month,
CASE
when rank=1 then 'NEW USER'
when rank>=2 then 'OLD USER'
END AS user,
count(distinct user_wallet_address) as "Number of users"
FROM swap_users
WHERE BLOCK_TIMESTAMP>=current_date-365
GROUP BY month,user
Run a query to Download Data