Updated 2022-12-31
    with eth_price as
    (
    select hour::date as day,
    avg (price) as USDPrice
    from ethereum.core.fact_hourly_token_prices
    where symbol = 'WETH'
    group by 1
    ),

    SOL_Price as
    (
    select block_timestamp::date as day,
    median (swap_to_amount/swap_from_amount) as USDPrice
    from solana.fact_swaps
    where swap_from_mint = 'So11111111111111111111111111111111111111112' --SOL
    and swap_to_mint in ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v','Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB') --USDC,USDT
    and swap_to_amount > 0
    and swap_from_amount > 0
    and succeeded = 'TRUE'
    group by 1
    ),

    algo_price as
    (
    select block_hour::date as day,
    avg (price_usd) as usdprice
    from algorand.defi.ez_price_pool_balances
    where asset_id = '0'
    group by 1
    ),

    flow_price as
    (
    select timestamp::date as day,
    avg (price_usd) as usdprice
    from flow.core.fact_prices
    Run a query to Download Data