drone-mostafaUntitled Query
    Updated 2022-07-11
    with lst_from as (
    select
    TX_ID
    ,PROJECT_NAME name
    from osmosis.core.fact_swaps f
    join osmosis.core.dim_labels d on d.ADDRESS = f.FROM_CURRENCY
    where block_timestamp::date>='2022-05-01'
    )
    , lst_to as (
    select
    TX_ID
    ,PROJECT_NAME name
    from osmosis.core.fact_swaps f
    join osmosis.core.dim_labels d on d.ADDRESS = f.TO_CURRENCY
    where block_timestamp::date>='2022-05-01'
    )
    ,lst_top as (
    select top 10
    case
    when f.name ||'_'|| t.name='OSMO_ATOM' then 'ATOM_OSMO'
    when f.name ||'_'|| t.name='LUM_OSMO' then 'OSMO_LUM'
    when f.name ||'_'|| t.name='DVPN_OSMO' then 'OSMO_DVPN'
    else f.name ||'_'|| t.name
    end contract
    ,count( s.TX_ID) as tx_count
    from osmosis.core.fact_swaps s
    join lst_from f on f.TX_ID = s.tx_id
    join lst_to t on t.TX_ID = s.tx_id
    where block_timestamp::date>='2022-05-01'
    and TX_STATUS='SUCCEEDED'
    group by 1
    order by tx_count DESC
    )
    select
    block_timestamp::date as day
    ,case
    Run a query to Download Data