ArioMUX Users
Updated 2024-04-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
33
›
⌄
with All_TXs as (
SELECT
block_timestamp,
from_address as user_address
from avalanche.core.fact_transactions
where
to_address = '0x5898c3e218a8501533d771c86e2fa37743ea2add'
and STATUS = 'SUCCESS'
),
first_txs as (
select
user_address
, min(block_timestamp) as first_timestamp
from avalanche.core.fact_transactions
inner join (select distinct user_address from all_txs) users
on fact_transactions.from_address = users.user_address
where STATUS = 'SUCCESS'
and fact_transactions.to_address = '0x5898c3e218a8501533d771c86e2fa37743ea2add'
group by 1
),
aggregated as (
select
date_trunc('week', block_timestamp) as date
, iff(first_timestamp ::date = block_timestamp ::date, 'New', 'Old') as category
, count(distinct user_address) as users
from all_txs
left join first_txs
using(user_address)
group by 1,2
)
select *
from aggregated
order by date desc, category desc
QueryRunArchived: QueryRun has been archived