Afonso_DiazUntitled Query
    Updated 2023-01-22
    with t as (
    select
    recorded_hour::date as day,
    currency,
    avg(price) as price_usd
    from osmosis.core.ez_prices
    group by 1, 2
    )

    select
    day,
    count(distinct tx_id) as swaps_count,
    count(distinct trader) as swappers_count,
    sum(swaps_count) over(order by day) as cumulative_swaps_count,
    sum(swappers_count) over(order by day) as cumulative_swappers_count,
    sum((from_amount / pow(10, from_decimal)) * price_usd) as volume_usd
    from osmosis.core.fact_swaps a
    join t on block_timestamp::date = day and t.currency = a.from_currency
    where tx_succeeded = 1
    and block_timestamp >= current_date - 90
    group by day
    order by day
    Run a query to Download Data