0xHaM-dTransactions by services
    Updated 2025-01-22
    -- forked from MLDZMN / activity by services @ https://flipsidecrypto.xyz/MLDZMN/q/fQrxp0_08eub/activity-by-services
    -- with priceTb as (
    -- SELECT
    -- date_trunc('week',hour) as p_date,
    -- -- HOUR::date as p_date,
    -- -- HOUR,
    -- SYMBOL,
    -- -- price
    -- avg(price) as avg_price
    -- FROM gnosis.price.ez_prices_hourly
    -- WHERE SYMBOL = 'OLAS'
    -- GROUP by 1,2
    -- )
    with priceTb as (
    select
    date_trunc('week', date) as "Date",
    price as "Price",
    lag(price) over (order by "Date") as lag_price,
    round(100*("Price"-lag_price)/lag_price,2) as "Price Change %"
    from (
    select
    date_trunc(day, HOUR) as date,
    price,
    -- avg(PRICE) as price,
    rank() over (partition by date_trunc('week', HOUR) order by HOUR desc) as rank
    from gnosis.price.ez_prices_hourly
    where SYMBOL='OLAS'
    )
    where rank=1
    order by 1 desc
    )
    ,
    t1 as (
    select
    BLOCK_TIMESTAMP,
    tx_hash,
    QueryRunArchived: QueryRun has been archived