mu-tafaUntitled Query
    Updated 2022-07-04
    with tab1 as(SELECT
    date_trunc(day,block_timestamp) as date,
    count(DISTINCT tx_id) as tx_count
    from flipside_prod_db.thorchain.swaps
    where date>='2022-01-1'
    and not from_asset like '%USDC%'
    group by date),
    tab2 as
    (SELECT
    date_trunc(day,block_timestamp) as date,
    count(DISTINCT tx_id) as usdc_tx_count
    from flipside_prod_db.thorchain.swaps
    where date>='2022-01-1'
    and from_asset like '%USDC%'
    group by date)
    SELECT
    a.date,
    usdc_tx_count/tx_count*100 as USDC_SWAP_RATE
    from tab1 a left join tab2 b on a.date=b.date


    Run a query to Download Data