Afonso_Diazosmosis-fees-13
    Updated 2023-03-10
    with t as (
    select
    block_date::date as day,
    sum(fees_usd) as fee_usd
    from osmosis.core.fact_pool_fee_day
    where fees_usd is not null
    and day > current_date - interval '{{ months }} months'
    group by 1
    ),

    t2 as (
    select
    block_timestamp::date as day,
    count(distinct tx_id) as swaps,
    count(distinct trader) as swappers,
    sum(swaps) over (order by day) as cumulative_swaps
    from osmosis.core.fact_swaps
    where block_timestamp > current_date - interval '{{ months }} months'
    group by 1
    order by 1
    )

    select * from t join t2 using(day) order by day
    Run a query to Download Data