datavortexvs other dex
    Updated 2025-04-23
    SELECT
    project,
    COUNT(DISTINCT tx_hash) AS "total swaps",
    COUNT(DISTINCT pool_address) AS "total pools",
    COUNT(DISTINCT trader_address) AS "total traders",
    SUM(volume_ton) AS "total swap volume (TON)",
    SUM(volume_usd) AS "total swap volume (USD)",
    AVG(volume_usd) AS "avg swap volume (USD)",
    COUNT(DISTINCT tx_hash) * 1.0 / NULLIF(COUNT(DISTINCT trader_address), 0) AS "avg swaps per trader",
    SUM(volume_usd) / NULLIF(COUNT(DISTINCT pool_address), 0) AS "avg swap volume per pool (USD)"
    FROM
    ton.defi.fact_dex_trades
    WHERE
    volume_usd IS NOT NULL
    GROUP BY
    project
    ORDER BY
    "total swap volume (USD)" DESC;