MLDZMNhot1
    Updated 2022-07-12
    with tb1 as (select
    BLOCK_TIMESTAMP,
    TX_ID,
    PROJECT_NAME f1 ,
    TO_CURRENCY
    from osmosis.core.fact_swaps x left outer join osmosis.core.dim_labels y
    on x.FROM_CURRENCY = y.address
    ),

    tb2 as (select
    BLOCK_TIMESTAMP,
    TX_ID,
    f1,
    PROJECT_NAME f2
    from tb1 left outer join osmosis.core.dim_labels z on tb1.TO_CURRENCY = z.address ),

    tb3 as (select
    BLOCK_TIMESTAMP,
    TX_ID,
    f1,
    f2,
    CONCAT(f1, ' _ ', f2) as swap_pairs
    from tb2),

    swap_pp as (select
    swap_pairs,
    min(BLOCK_TIMESTAMP) as release_date
    from tb3
    group by 1
    )

    select
    release_date::date as day,
    count(distinct swap_pairs) as new_contracts,
    Run a query to Download Data