Sandeshswap from and to volume after cosmoverse
    Updated 2022-10-12
    with stars_price as
    (
    select
    recorded_at::date as "date",
    symbol as stars_symbol,
    avg(price) as stars_price,
    avg(volume_24h) as stars_volume
    from osmosis.core.dim_prices
    where 1=1
    and symbol='STARS'
    and recorded_at > '2022-09-12'
    group by "date",stars_symbol
    ),
    swaps_from_stars as
    (
    select
    fs.*,
    'STARS' as from_currency,
    coalesce(dl.project_name,fs.to_currency) as to_symbol,
    p.stars_price*fs.from_amount/1e6 as usd
    from
    osmosis.core.fact_swaps fs
    left join
    osmosis.core.dim_labels dl
    on fs.to_currency=dl.address
    left join
    stars_price p
    on fs.block_timestamp::date=p."date"
    where
    1=1
    and fs.from_currency='ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4'
    and fs.block_timestamp > '2022-09-26'
    and fs.tx_status='SUCCEEDED'
    ),
    swaps_to_stars as
    Run a query to Download Data