SajjadiiiSwaps Swappers Age copy
    Updated 2024-12-02
    -- forked from alitaslimi / Swaps Swappers Age @ https://flipsidecrypto.xyz/alitaslimi/q/UFUsentyHAd8/swaps-swappers-age

    with price_tab AS (
    SELECT hour::date AS date
    ,symbol
    ,token_address
    ,avg(price) AS token_price
    FROM kaia.price.ez_prices_hourly
    WHERE hour::date >= current_date - interval '1 year'
    GROUP BY 1 , 2 , 3

    UNION all

    SELECT
    hour::date AS date
    ,'USDC.e' AS symbol
    ,'0xe2053bcf56d2030d2470fb454574237cf9ee3d4b' AS token_address
    ,1 AS token_price
    FROM kaia.price.ez_prices_hourly
    WHERE symbol = 'KLAY'
    AND hour::date >= current_date - interval '1 year'
    GROUP BY 1 , 2 , 3

    UNION all

    SELECT
    hour::date AS date
    ,'USDC' AS symbol
    ,'0x608792deb376cce1c9fa4d0e6b7b44f507cffa6a' AS token_address
    ,1 AS token_price
    FROM kaia.price.ez_prices_hourly
    WHERE symbol = 'KLAY'
    AND hour::date >= current_date - interval '1 year'
    GROUP BY 1 , 2 , 3

    UNION all
    Last run: about 1 month ago
    Type
    Swappers
    1
    Active9749
    2
    New98773
    2
    31B
    422s