dannyamahTotal Tokens
    Updated 2024-09-27
    SELECT
    blockchain,
    COUNT(DISTINCT token_traded) AS total_unique_tokens
    FROM (
    -- Base chain
    SELECT
    'Base' AS blockchain,
    token_in AS token_traded
    FROM base.defi.ez_dex_swaps
    WHERE platform ILIKE '%uniswap%'
    UNION ALL
    SELECT
    'Base' AS blockchain,
    token_out AS token_traded
    FROM base.defi.ez_dex_swaps
    WHERE platform ILIKE '%uniswap%'

    -- Ethereum chain
    UNION ALL
    SELECT
    'Ethereum' AS blockchain,
    token_in AS token_traded
    FROM ethereum.defi.ez_dex_swaps
    WHERE platform ILIKE '%uniswap%'

    UNION ALL

    SELECT
    'Ethereum' AS blockchain,
    token_out AS token_traded
    FROM ethereum.defi.ez_dex_swaps
    WHERE platform ILIKE '%uniswap%'

    -- Optimism chain
    QueryRunArchived: QueryRun has been archived