adriaparcerisasflow stats: contracts (over time) weekly
    Updated 5 days ago
    WITH news AS (
    SELECT DISTINCT event_contract AS new_contract,
    MIN(trunc(block_timestamp, 'week')) AS debut
    FROM flow.core.fact_events
    GROUP BY 1
    ),
    evm_news AS (
    SELECT DISTINCT contract_address AS new_contract,
    MIN(trunc(block_timestamp, 'week')) AS debut
    FROM flow.core_evm.fact_event_logs
    GROUP BY 1
    ),
    combined_news AS (
    SELECT new_contract, debut FROM news
    UNION ALL
    SELECT new_contract, debut FROM evm_news
    ),
    final as (
    SELECT
    trunc(x.block_timestamp, 'week') AS date,
    COUNT(DISTINCT x.event_contract) AS active_contracts
    FROM flow.core.fact_events x
    WHERE x.tx_succeeded = 'true' and date<trunc(current_date,'week')
    GROUP BY 1

    UNION ALL

    SELECT
    trunc(y.block_timestamp, 'week') AS date,
    COUNT(DISTINCT y.contract_address) AS active_contracts
    FROM flow.core_evm.fact_event_logs y where date>'2020-01-01' and date<trunc(current_date,'week')
    GROUP BY 1
    ORDER BY date ASC
    )
    select date, sum(active_contracts) as active_contracts from final group by 1 order by 1 desc
    Last run: 4 days ago
    DATE
    ACTIVE_CONTRACTS
    1
    2025-04-07 00:00:00.000773
    2
    2025-03-31 00:00:00.000682
    3
    2025-03-24 00:00:00.000605
    4
    2025-03-17 00:00:00.000631
    5
    2025-03-10 00:00:00.000504
    6
    2025-03-03 00:00:00.000475
    7
    2025-02-24 00:00:00.000567
    8
    2025-02-17 00:00:00.000593
    9
    2025-02-10 00:00:00.000491
    10
    2025-02-03 00:00:00.000471
    11
    2025-01-27 00:00:00.000443
    12
    2025-01-20 00:00:00.000433
    13
    2025-01-13 00:00:00.000492
    14
    2025-01-06 00:00:00.000409
    15
    2024-12-30 00:00:00.000376
    16
    2024-12-23 00:00:00.000494
    17
    2024-12-16 00:00:00.000459
    18
    2024-12-09 00:00:00.000446
    19
    2024-12-02 00:00:00.000458
    20
    2024-11-25 00:00:00.000413
    ...
    243
    8KB
    46s