Rodolfo-LimaInactive Users in the Winter
    Updated 2023-09-26
    WITH users_before_winter AS (
    SELECT
    MIN(DATE(BLOCK_TIMESTAMP)) AS first_date,
    ORIGIN_FROM_ADDRESS
    FROM
    ethereum.core.ez_dex_swaps
    WHERE
    platform = 'uniswap-v3'
    AND DATE(BLOCK_TIMESTAMP) < '2021-12-01' -- Before the winter beginning
    GROUP BY
    ORIGIN_FROM_ADDRESS
    ORDER BY
    first_date DESC
    ),

    active_users AS (
    SELECT
    u.ORIGIN_FROM_ADDRESS,
    COALESCE(s.active, 'Inactive') AS active
    FROM
    users_before_winter u
    LEFT JOIN
    (
    SELECT
    ORIGIN_FROM_ADDRESS,
    'Active' AS active
    FROM
    ethereum.core.ez_dex_swaps
    WHERE
    platform = 'uniswap-v3'
    AND DATE(BLOCK_TIMESTAMP) >= '2021-12-01'

    ) s ON s.ORIGIN_FROM_ADDRESS = u.ORIGIN_FROM_ADDRESS
    )

    Run a query to Download Data