0xHaM-dDistribution of Deployed Contracts Type by User & Txs Count
    Updated 2023-01-17
    with first_date_contract as (
    select
    tx:body:messages[0]:contract as new_dep_contracts,
    min(block_timestamp) as min_date,
    count(distinct tx_id) as transactions,
    count(distinct tx_sender) as users
    from terra.core.dim_address_labels join terra.core.fact_transactions on address=tx:body:messages[0]:contract
    group by 1
    )
    select
    label_type,
    count(distinct tx_id) as tx_cnt,
    count(distinct tx_sender) as usr_cnt
    from terra.core.dim_address_labels join terra.core.fact_transactions on address = tx:body:messages[0]:contract
    WHERE tx:body:messages[0]:contract in (SELECT new_dep_contracts from first_date_contract)
    AND block_timestamp::date <= CURRENT_DATE - 1
    group by 1


    Run a query to Download Data