jackguyss 77
    Updated 2024-01-30
    -- Step 1: Get unique SWAPPER and platform combinations
    WITH unique_swapper_platform AS (
    SELECT DISTINCT
    SWAPPER,
    platform
    FROM sei.defi.fact_dex_swaps
    ),
    -- Step 2: Count the number of unique platforms for each SWAPPER
    user_dex_count AS (
    SELECT
    SWAPPER,
    COUNT(platform) AS num_dex_used
    FROM unique_swapper_platform
    GROUP BY SWAPPER
    ),
    -- Step 3: Count the number of users for each number of platforms used
    users_by_dex_count AS (
    SELECT
    num_dex_used,
    COUNT(*) AS users_count
    FROM user_dex_count
    GROUP BY num_dex_used
    )
    -- Final Output: Display the number of users for each number of DEXs used
    SELECT
    num_dex_used,
    users_count
    FROM users_by_dex_count
    ORDER BY num_dex_used;
    Last run: about 1 year agoAuto-refreshes every 6 hours
    NUM_DEX_USED
    USERS_COUNT
    1
    146186
    2
    2969
    3
    3194
    3
    27B
    4s