mmdrezaSwapped to
    Updated 2022-10-12
    with prices as (select
    date_trunc('day',recorded_at)as date,
    avg(price) as daily_price
    from osmosis.core.dim_prices
    where symbol like 'STARS'
    and recorded_at>= current_date-7
    group by 1),

    from_swappers as (select
    count(distinct trader) as from_swappers,
    count(tx_id) as transactions,
    (sum(FROM_AMOUNT/pow(10,6))) as from_amount
    from osmosis.core.fact_swaps
    where from_currency = 'ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4'
    and block_timestamp >= current_date-7
    and TX_STATUS = 'SUCCEEDED'),

    to_swappers as (select
    count(distinct trader) as to_swappers,
    count(tx_id) as transactions,
    (sum(to_AMOUNT/pow(10,6))) as to_amount
    from osmosis.core.fact_swaps
    where to_currency = 'ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4'
    and block_timestamp >= current_date-7
    and TX_STATUS = 'SUCCEEDED'),

    daily_traders as (
    select
    date_trunc('day',block_timestamp) as date,
    count(distinct trader) as traders
    from osmosis.core.fact_swaps
    where block_timestamp >= current_date-7
    and to_currency = 'ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4'
    or from_currency = 'ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4'
    and block_timestamp >= current_date-7
    and TX_STATUS = 'SUCCEEDED'
    Run a query to Download Data