Salehaptos_new_users_type_date_24
    Updated 2024-01-24
    with lst_all as (
    select
    block_timestamp::date as date
    ,tx_hash
    ,sender as wallet
    ,event_address
    ,iff( INITCAP(LABEL_TYPE)='Token','Defi',INITCAP(LABEL_TYPE)) as Type
    ,LABEL
    ,ADDRESS_NAME
    ,LABEL_SUBTYPE
    from aptos.core.fact_events
    join aptos.core.dim_labels on address = event_address
    join aptos.core.fact_transactions using(tx_hash)
    where SUCCESS=true
    and tx_type='user_transaction'
    )
    ,lst_new as (
    select
    sender
    ,min(block_timestamp)::date as min_date
    from aptos.core.fact_transactions
    group by 1
    )
    ,lst_aptos_price as (
    with lst_all_price as (
    select
    TO_TIMESTAMP(value[0]::string) as avg_date
    ,value[1] as avg_price
    from (
    select livequery.live.udf_api(
    'https://api.coingecko.com/api/v3/coins/aptos/market_chart?vs_currency=usd&days=200&interval=daily&precision=3') as resp
    )
    ,lateral flatten (input => resp:data:prices)
    )
    select
    date_trunc(week,avg_date) as avg_date
    Last run: over 1 year ago
    DATE
    TYPE
    WALLETS
    TXS
    Cumulative Active New Users
    Cumulative Number of Transactions by Active New Users
    1
    2024-01-22 00:00:00.000Defi149524993026451317038
    2
    2024-01-22 00:00:00.000Nft95312953356403768632
    3
    2024-01-22 00:00:00.000Dex10088310856088376121220243
    4
    2024-01-22 00:00:00.000Dapp91187254219298856
    5
    2024-01-22 00:00:00.000Bridge177425618235054277097
    5
    301B
    37s