winnie-fsAptos Base - [chain] account first time transaction
Updated 2023-11-22
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
asdedafdsdfasdfswe as (
select
block_timestamp
, address
, version
-- , change_data
from aptos.core.fact_changes
inner join aptos.core.fact_transactions
using(block_timestamp, version, success)
where tx_type = 'user_transaction'
and change_type = 'write_resource'
and change_module = 'account'
and change_data :sequence_number ::int = 1
and address = sender
and block_timestamp ::date > current_date() - interval '{{days}} days' - interval '7 days'
)
select
date_trunc('{{date_trunc}}', block_timestamp) as date
, count(distinct address) as accounts
, avg(accounts) over (order by date rows between 6 preceding and current row) as "7D Avg."
from asdedafdswe
group by 1
qualify date > current_date() - interval '{{days}} days'
Run a query to Download Data