rackhaelUNISWAP TRADER DISTRIBUTION ON BASE
    Updated 2023-11-22
    -- forked from UNISWAP TRADER DISTRIBUTION ON ARBITRUM @ https://flipsidecrypto.xyz/edit/queries/c9a2d6ac-e449-4c6d-9a98-b76b46b945a0

    -- forked from UNISWAP TRADER DISTRIBUTION ON POLYGON @ https://flipsidecrypto.xyz/edit/queries/15b893d2-1643-4b37-a449-fa436d82198a

    -- forked from UNISWAP TRADER DISTRIBUTION ON OPTIMISM @ https://flipsidecrypto.xyz/edit/queries/905fee0f-d7e3-4c58-b39c-284344432a7a

    With TraderDistribution AS (
    SELECT
    tx_to,
    DATE_TRUNC('MONTH', BLOCK_TIMESTAMP) AS transaction_month,
    CASE
    WHEN PLATFORM IN ('uniswap-v2', 'uniswap-v3') THEN 'Uniswap'
    ELSE 'Other DEXs'
    END AS Dex
    FROM base.defi.ez_dex_swaps
    )

    SELECT
    transaction_month,
    dex,
    COUNT(DISTINCT tx_to) AS trader_count
    FROM TraderDistribution
    GROUP BY transaction_month, dex
    ORDER BY transaction_month, dex;




    Run a query to Download Data