JhanlycnTop Pairs Monthly
    Updated 2023-05-14
    WITH
    first_swaps AS (
    SELECT
    sender AS address,
    MIN(DATE_TRUNC('month', BLOCK_TIMESTAMP)) AS first_swap_month
    FROM
    ethereum.uniswapv3.ez_swaps
    GROUP BY
    sender
    UNION
    SELECT
    recipient AS address,
    MIN(DATE_TRUNC('month', BLOCK_TIMESTAMP)) AS first_swap_month
    FROM
    ethereum.uniswapv3.ez_swaps
    GROUP BY
    recipient
    ),
    new_swappers AS (
    SELECT
    address,
    first_swap_month
    FROM
    first_swaps
    WHERE
    first_swap_month >= DATEADD('month', -12, CURRENT_DATE())
    ),
    pair_swaps AS (
    SELECT
    DATE_TRUNC('month', BLOCK_TIMESTAMP) AS month,
    CONCAT(TOKEN0_SYMBOL, '/', TOKEN1_SYMBOL) AS pair,
    COUNT(*) AS pair_amount
    FROM
    ethereum.uniswapv3.ez_swaps
    WHERE
    (
    Run a query to Download Data