MoeHIPHIP
    Updated 2022-11-28
    with prices as (
    select
    RECORDED_AT::date as days , SYMBOL,
    avg(price) as prices
    from
    osmosis.core.dim_prices
    where provider ilike 'coinmarketcap'
    group by 1 ,2
    )

    ,base as (
    select
    l.*, PROJECT_NAME as LABEL
    from
    osmosis.core.fact_swaps l , osmosis.core.dim_labels b
    where FROM_CURRENCY = b.ADDRESS
    )

    ,fin as (
    select
    b.*,prices,FROM_AMOUNT/pow(10,FROM_DECIMAL) as native_amount ,
    native_amount*prices as FROM_AMOUNT_usd
    from
    base b,prices p
    where
    block_timestamp::date = days and LABEL = SYMBOL
    )



    select
    'Headfirst' as type ,
    count(*) as swaps,
    Run a query to Download Data