Eman-RazUsers Over Time
    Updated 2024-01-16
    with table1 as (select date_trunc('{{Time_Frame}}',block_timestamp) as "Date", count(distinct sender) as "Total Users"
    from aptos.core.fact_transactions
    where sender is not null and success='true'
    group by 1
    order by 1),

    table2 as (with tab1 as (select sender, min(block_timestamp::date) as first_tx
    from aptos.core.fact_transactions
    where success='true'
    group by 1)

    select date_trunc('{{Time_Frame}}',first_tx) as "Date", count(distinct sender) as "New Users"
    from tab1
    group by 1)

    select table1."Date" as "Date", "Total Users", "Total Users"-"New Users" as "Active Users", "New Users"
    from table1 left join table2 on table1."Date"=table2."Date"
    where table1."Date">='{{Start_Date}}' and table1."Date"<='{{End_Date}}'
    order by 1
    Last run: 7 days ago
    Date
    Total Users
    Active Users
    New Users
    1
    2023-01-01 00:00:00.000356660115772240888
    2
    2023-02-01 00:00:00.00020513798008107129
    3
    2023-03-01 00:00:00.00021472699904114822
    4
    2023-04-01 00:00:00.000327525106098221427
    5
    2023-05-01 00:00:00.000300204100106200098
    6
    2023-06-01 00:00:00.000309196111847197349
    7
    2023-07-01 00:00:00.00011641851415941022591
    8
    2023-08-01 00:00:00.00017389952427431496252
    9
    2023-09-01 00:00:00.000914476243230671246
    10
    2023-10-01 00:00:00.0001516775518812997963
    11
    2023-11-01 00:00:00.000746344266282480062
    12
    2023-12-01 00:00:00.000989278339337649941
    13
    2024-01-01 00:00:00.00016224893716331250856
    13
    643B
    173s