buzzresearchBoB testing
    Updated 2024-08-24
    -- Average Prices Per Day
    WITH AveragePrices AS (
    SELECT
    DATE(hour) AS avg_date,
    token_address,
    AVG(price) AS avg_price
    FROM
    ethereum.price.ez_prices_hourly
    GROUP BY
    1, 2
    ),

    -- Latest Price for Specific Token
    LatestPrice AS (
    SELECT
    hour AS latest_hour,
    price AS latest_price
    FROM
    ethereum.price.ez_prices_hourly
    WHERE
    token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    AND price > 0
    ORDER BY
    1 DESC
    LIMIT 1
    ),

    -- Token Transfers and Native Transfers
    TokenTransfers AS (
    SELECT
    block_timestamp,
    from_address AS user,
    to_address AS pool,
    amount AS transfer_amount,
    symbol,
    contract_address
    QueryRunArchived: QueryRun has been archived