0xHaM-dCopy of Untitled Query
    Updated 2023-01-02
    with first_date_contract as (
    select
    project_name,
    min(block_timestamp) as min_date,
    count(distinct tx_id) as tx_cnt,
    count(distinct tx_sender) as usr_cnt
    from terra.core.dim_address_labels y
    join terra.core.fact_transactions z on address=tx:body:messages[0]:contract
    group by 1
    )
    SELECT
    date_Trunc('{{Frequency}}',min_date) as date,
    project_name,
    tx_cnt,
    usr_cnt,
    row_number() over (partition by date order by usr_cnt) as rn
    from first_date_contract where min_date >= CURRENT_DATE-INTERVAL '{{Past_Days}} DAY'
    -- order by 1 asc,3 desc
    qualify rn <= 10
    Run a query to Download Data