saeedmznSwap Fees - over time
    Updated 2022-06-24
    -- replace(fee,'uosmo','')::NUMERIC/1e6
    with swaps_from as (
    select
    block_timestamp::date as date ,
    count(DISTINCT trader) as num_traders ,
    sum (replace(fee,'uosmo','')::NUMERIC/1e6) as fees ,
    count (DISTINCT tx_id) as num_swaps
    from osmosis.core.fact_swaps join osmosis.core.fact_transactions using (tx_id)
    where FROM_CURRENCY = 'uosmo'
    and FROM_AMOUNT>0
    and TO_CURRENCY != 'uosmo'
    and fee ilike '%uosmo%'
    and TX_STATUS = 'SUCCEEDED'
    group by 1
    ),
    swaps_to as (
    select block_timestamp::date as date ,
    count(DISTINCT trader) as num_traders ,
    sum (replace(fee,'uosmo','')::NUMERIC/1e6) as fees ,
    count (DISTINCT tx_id) as num_swaps
    from osmosis.core.fact_swaps join osmosis.core.fact_transactions using (tx_id)
    where FROM_CURRENCY != 'uosmo'
    and FROM_AMOUNT>0
    and TO_CURRENCY = 'uosmo'
    and fee ilike '%uosmo%'
    and TX_STATUS = 'SUCCEEDED'
    group by 1
    ),
    other_swaps as (
    select block_timestamp::date as date ,
    count(DISTINCT trader) as num_traders ,
    sum (replace(fee,'uosmo','')::NUMERIC/1e6) as fees ,
    count (DISTINCT tx_id) as num_swaps
    from osmosis.core.fact_swaps join osmosis.core.fact_transactions using (tx_id)
    where FROM_CURRENCY != 'uosmo'
    and FROM_AMOUNT>0
    Run a query to Download Data