Salehapt_tx_date_status
Updated 2024-05-26
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
34
35
36
›
⌄
with lst_price as (
select
hour::date as price_date
,avg(price) as APT_price
from aptos.price.ez_hourly_token_prices
where symbol='APT'
group by 1
order by 1
)
,lst_new_users as (
select
sender as new_user
,min(block_timestamp)::date as min_date
from aptos.core.fact_transactions
where SUCCESS
group by 1
)
,lst_group_new_users as (
select
min_date
,count(DISTINCT new_user) as "New Users"
from lst_new_users
group by 1
order by 1
)
select
date_trunc(week,block_timestamp)::date as date
,"New Users"
,count( DISTINCT tx_hash ) as "TXs"
,"TXs"/24/60/60 as "Avg. Transactions/sec"
,count(DISTINCT sender) as Wallets
,sum(gas_unit_price*gas_used/1e8) as "Total Gas Received"
,avg("TXs") over (order by date rows between 6 preceding and current row) as seven_day_avg_transaction
,"Total Gas Received" / "TXs" as "Gas per Transaction Ratio"
,sum("New Users") over(order by date) as cum_new_users
from aptos.core.fact_transactions
QueryRunArchived: QueryRun has been archived