Afonso_DiazOvertime
    Updated 2025-03-06
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    origin_from_address as user,
    origin_to_address as contract_address
    from
    ink.core.fact_event_logs
    where
    tx_succeeded
    ),

    t1 as (
    select
    date_trunc('{{ period }}', block_timestamp) as date,
    count(distinct tx_hash) as transactions,
    count(distinct contract_address) as active_contracts,
    count(distinct user) as users,
    sum(transactions) over (order by date) as cumulative_transactions
    from
    main
    group by 1
    ),

    t2 as (
    select
    date_trunc('{{ period }}', min_date) as date,
    count(distinct contract_address) as new_contract
    from (
    select
    contract_address,
    min(block_timestamp) as min_date
    from
    main
    Last run: about 1 month ago
    DATE
    TRANSACTIONS
    ACTIVE_CONTRACTS
    USERS
    CUMULATIVE_TRANSACTIONS
    NEW_CONTRACTS
    OLD_CONTRACTS
    1
    2024-12-07 00:00:00.000211210
    2
    2024-12-08 00:00:00.000211401
    3
    2024-12-09 00:00:00.00037444131
    4
    2024-12-10 00:00:00.00018445931
    5
    2024-12-11 00:00:00.00092196151163
    6
    2024-12-12 00:00:00.0002391512390123
    7
    2024-12-13 00:00:00.0002022812592235
    8
    2024-12-14 00:00:00.0001198971153
    9
    2024-12-15 00:00:00.0001012381202
    10
    2024-12-16 00:00:00.000279492110912920
    11
    2024-12-17 00:00:00.0001262513913781371612415
    12
    2024-12-18 00:00:00.0002464629639173836223957
    13
    2024-12-19 00:00:00.00020712366598059074266100
    14
    2024-12-20 00:00:00.00011347233230270421124109
    15
    2024-12-21 00:00:00.000777920119197820092109
    16
    2024-12-22 00:00:00.00076981901895858989694
    17
    2024-12-23 00:00:00.0001011118726779600986101
    18
    2024-12-24 00:00:00.00016793188443811280281107
    19
    2024-12-25 00:00:00.00018705206417713150711096
    20
    2024-12-26 00:00:00.00021567186549315307471115
    90
    5KB
    8s