PS0G1Monthly transfer volume USD into Osmosis
    Updated 2022-11-17
    --credit misaghlb
    with prices as (
    select date(recorded_at) as pdate,
    lower(symbol) as symbol1,
    avg(price) as USDPrice
    from osmosis.core.dim_prices
    group by 1,2

    union ALL

    select date(hour) as pdate,
    case when symbol = 'USDC' then 'USDC.axl'
    when symbol = 'USDT' then 'USDT.axl'
    when symbol = 'aTUSD' then 'USDC.grv'
    when symbol = 'sUSD' then 'USDT.grv'
    when symbol = 'iUSD' then 'USDX'
    when symbol = 'WETH' then 'WETH.axl'
    when symbol = 'aWETH' then 'WETH.grv'
    when symbol = 'WBTC' then 'WBTC.axl'
    when symbol = 'uWBTC' then 'WBTC.grv'
    when symbol = 'DAI' then 'DAI.axl'
    when symbol = 'aDAI' then 'DAI.grv'
    when symbol = 'FRAX' then 'FRAX.axl'
    else lower(symbol) end as symbol1,
    avg(price) as USDPrice
    from ethereum.core.fact_hourly_token_prices
    group by 1,2
    ),
    calc as (
    select block_timestamp,
    case when PROJECT_NAME = 'PSTAKE' then 18
    when PROJECT_NAME = 'INJ' then 18
    when PROJECT_NAME like '%WETH%%' then 18
    when PROJECT_NAME like '%DAI%' then 18
    when PROJECT_NAME like '%WBTC%' then 8
    else decimal end as deci,
    Run a query to Download Data