Flipside TeamTop platforms by swap volume over the last three months
    Updated 2024-09-26
    with price_tab AS (

    SELECT
    hour::date as date,
    avg(price)::string as price,
    'WETH' :: string AS token_symbol,
    '0x98a8345bb9d3dda9d808ca1c9142a28f6b0430e1' :: string AS token_contract,
    '0x3ce1aa52eeaf57a355939c09ac76f03f01988f13' :: string AS pool_contract_address
    FROM ethereum.price.ez_prices_hourly
    WHERE symbol = 'WETH'
    AND token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    AND hour::date >= current_date - interval '365 day'
    GROUP BY 1

    UNION all

    SELECT
    hour::date as date,
    avg(price)::string as price,
    'WKLAY' :: string AS token_symbol,
    '0x19aac5f612f524b754ca7e7c41cbfa2e981a4432' :: string AS token_contract,
    '0x8a5562d2a17488647381c1a0e9cf527a01b6f3bd' :: string AS pool_contract_address
    FROM kaia.price.ez_prices_hourly
    WHERE symbol = 'KLAY'
    AND hour::date >= current_date - interval '365 day'
    GROUP BY 1

    UNION all

    SELECT
    hour::date as date,
    '1'::string as price,
    'USDT' :: string AS token_symbol,
    '0x5c13e303a62fc5dedf5b52d66873f2e59fedadc2' :: string AS token_contract,
    '0xa856b5da8e85b23395c17783954edda010317fce' :: string AS pool_contract_address
    FROM kaia.price.ez_prices_hourly
    QueryRunArchived: QueryRun has been archived