Salehthorswap_date_new_user
Updated 2024-10-08
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
›
⌄
with lst_all as (
select
block_timestamp::date as date
,tx_id
,from_address as wallet
,split(pool_name,'-')[0] as Pool
,iff( FROM_AMOUNT_USD>=TO_AMOUNT_USD,FROM_AMOUNT_USD,TO_AMOUNT_USD) as amount_usd
from thorchain.defi.fact_swaps
-- where block_timestamp::date>='2024-01-01'
where AFFILIATE_ADDRESS in('T','t','thor160yye65pf9rzwrgqmtgav69n6zlsyfpgm9a7xk')
and _TX_TYPE='swap'
)
,lst_new as (
select
wallet
,min(date) as min_date
from lst_all
group by 1
)
select
min_date as date
,count(DISTINCT wallet) "New Users"
,sum("New Users") over(order by date) as "CUM New Users"
from lst_new
where min_date>='2024-01-01'
group by 1
order by 1
QueryRunArchived: QueryRun has been archived