Updated 2025-01-24
    WITH overall_swapper_activity AS (
    SELECT
    symbol_in,
    COUNT(DISTINCT swapper) AS swapper_count,
    COUNT(DISTINCT tx_id) AS swap_count,
    SUM(amount_in_usd) AS total_volume,
    ROW_NUMBER() OVER (ORDER BY COUNT(DISTINCT tx_id) DESC, SUM(amount_in_usd) DESC) AS rank
    FROM
    sei.defi.ez_dex_swaps
    GROUP BY
    symbol_in
    )
    SELECT
    symbol_in,
    swapper_count,
    swap_count,
    total_volume
    FROM
    overall_swapper_activity
    WHERE
    rank <= 10
    ORDER BY
    swap_count DESC, total_volume DESC;

    QueryRunArchived: QueryRun has been archived