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'
    and TX_STATUS='SUCCEEDED'
    )
    , 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'
    and TX_STATUS='SUCCEEDED'
    )
    select top 10
    f.name
    ,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
    having f.name!='OSMO_OSMO'
    order by tx_count DESC


    Run a query to Download Data