messariflow stats: contracts (over time) weekly copy
    Updated 7 days ago
    -- forked from adriaparcerisas / flow stats: contracts (over time) weekly @ https://flipsidecrypto.xyz/adriaparcerisas/q/53VloPXuY8mq/flow-stats-contracts-over-time-weekly


    with
    news as (
    select distinct event_contract as new_contract,
    min(trunc(block_timestamp,'day')) as debut
    from flow.core.fact_events
    group by 1
    )
    select
    trunc(x.block_timestamp,'day') as date,
    count(distinct event_contract) as active_contracts
    --,
    --count(distinct new_contract) as new_contracts,
    --sum(new_contracts) over (order by date) as unique_contracts
    from flow.core.fact_events x
    --join news n on trunc(x.block_timestamp,'week')=debut
    where
    x.tx_succeeded='true' --and x.block_timestamp<trunc(current_date,'week')
    group by 1
    order by 1 asc



    Last run: 7 days ago
    DATE
    ACTIVE_CONTRACTS
    1
    2020-08-18 00:00:00.0006
    2
    2020-08-19 00:00:00.0005
    3
    2020-08-20 00:00:00.0005
    4
    2020-08-21 00:00:00.0005
    5
    2020-08-22 00:00:00.0005
    6
    2020-08-23 00:00:00.0005
    7
    2020-08-24 00:00:00.0005
    8
    2020-08-25 00:00:00.0005
    9
    2020-08-26 00:00:00.0006
    10
    2020-08-27 00:00:00.0006
    11
    2020-08-28 00:00:00.0005
    12
    2020-08-29 00:00:00.0005
    13
    2020-08-30 00:00:00.0005
    14
    2020-08-31 00:00:00.0005
    15
    2020-09-01 00:00:00.0005
    16
    2020-09-02 00:00:00.0005
    17
    2020-09-03 00:00:00.0005
    18
    2020-09-04 00:00:00.0005
    19
    2020-09-05 00:00:00.0005
    20
    2020-09-06 00:00:00.0005
    ...
    1703
    53KB
    45s