hessNew MemeCoin Growth
    Updated 2023-05-15
    with price as ( select hour::date as date, symbol , avg(price) as avg_price
    from crosschain.core.ez_hourly_prices
    where token_address in ('0x6982508145454ce325ddbe47a25d4ec3d2311933',
    lower('0x6B89B97169a797d94F057F4a0B01E2cA303155e4'),'0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',
    '0xba2ae424d960c26247dd6c32edc70b295c744c43','DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263',
    lower('0x7D8146cf21e8D7cbe46054e01588207b51198729'),'0xa35923162c49cf95e6bf26623385eb431ad920d3')
    group by 1,2
    UNION
    select RECORDED_HOUR::date as date, symbol, avg(close) as avg_price
    from solana.core.fact_token_prices_hourly
    where symbol = 'BONK'
    group by 1,2)
    ,
    max_price as ( select date, symbol , avg_price ,
    rank() over (partition by symbol order by avg_price desc) as max_price
    from price
    qualify max_price = 1)
    ,
    min_price as ( select date, symbol , avg_price ,
    rank() over (partition by symbol order by avg_price asc) as min_price
    from price
    where avg_price is not null
    qualify min_price = 1)

    select a.symbol, a.date as min_date, b.date as max_date, datediff('day',a.date,b.date) as Days_from_atl_to_ATH,a.avg_price as min_price,
    b.avg_price as max_price, ((b.avg_price-a.avg_price)/a.avg_price)*100 as growth_percentage
    from min_price a join max_price b on a.symbol = b.symbol
    where a.symbol in ('PEPE','BOB','CHAD','BONK','TURBO')
    Run a query to Download Data