rackhaelFLOW HACKATHON new contracts test
    Updated 2023-03-23
    -- SELECT event_contract,
    -- count(distinct tx_id) as num_contracts
    -- FROM flow.core.fact_events
    -- WHERE event_type = 'AccountContractAdded'
    -- -- AND Block_timestamp :: date >= current_date - 30
    -- AND tx_succeeded = 'true'
    -- group by 1

    --

    -- SELECT *
    -- FROM flow.core.fact_events
    -- WHERE event_type = 'AccountContractAdded'


    -- select *
    -- from flow.core.fact_events
    -- where event_contract = ('0x75c4cd8fd6df393d')

    -- select *
    -- from flow.core.dim_contract_labels
    -- where contract_name = 'StaffCore'


    WITH NEW_CONTRACTS AS(
    SELECT date_trunc('day', block_timestamp) as date,
    contract_name,
    count(distinct tx_id) as daily_deployed_contracts
    FROM flow.core.fact_events a JOIN flow.core.dim_contract_labels b ON
    a.event_contract = b.event_contract
    WHERE event_type = 'AccountContractAdded'
    AND Block_timestamp :: date >= current_date - 30
    AND tx_succeeded = 'true'
    group by 1
    order by 2 desc
    ),
    Run a query to Download Data