jackguy2023-04-12 02:30 PM copy
    Updated 2023-05-09
    -- forked from 2023-04-12 02:30 PM @ https://flipsidecrypto.xyz/edit/queries/9ae22998-d1b7-496d-904b-a2e567904945

    with tab11 as (
    SELECT
    date_trunc('day', hour) as day1,
    symbol as symbol1,
    avg(price) as daily_price1
    FROM ethereum.core.fact_hourly_token_prices
    GROUP BY 1,2
    --WHERE blockchain LIKE 'near'
    --LIMIT 100
    ), tab1 as (
    SELECT
    date_trunc('day', timestamp) as day2,
    token_contract,
    symbol as saymbol2,
    median(price_usd) as daily_price2
    FROM near.core.fact_prices
    GROUP BY 1,2,3
    ), tab3 as (
    SELECT
    date_trunc('day', timestamp) as day3,
    token_contract as token_contract3,
    symbol as saymbol3,
    median(price_usd) as daily_price3
    FROM near.core.fact_prices
    GROUP BY 1,2,3
    )


    SELECT
    CASE when volume_usd < 10 then 'a Below $10 Volume'
    when volume_usd < 100 then 'b Between $10 - $100 Volume'
    when volume_usd < 1000 then 'c Between $100 - $1,000 Volume'
    when volume_usd < 10000 then 'd Between $1,000 - $10,000 Volume'
    when volume_usd < 100000 then 'e Between $10,000 - $100,000 Volume'
    Run a query to Download Data