datavortexSwap Counts Per Dex(Solana vs Ethereum)
    Updated 2024-11-05
    WITH SolanaPlatforms AS (
    SELECT
    swap_program AS "Platform",
    COUNT(DISTINCT tx_id) AS "SwapCount",
    SUM(swap_from_amount_usd) AS "Volume",
    ROW_NUMBER() OVER (
    ORDER BY
    COUNT(DISTINCT tx_id) DESC,
    SUM(swap_from_amount_usd) DESC
    ) AS rn
    FROM
    solana.defi.ez_dex_swaps
    WHERE
    block_timestamp BETWEEN '2024-10-01'
    AND '2024-10-31'
    AND swap_program IS NOT NULL
    AND swap_program <> ''
    GROUP BY
    swap_program
    ),
    EthereumPlatforms AS (
    SELECT
    platform AS "Platform",
    COUNT(DISTINCT tx_hash) AS "SwapCount",
    SUM(amount_in_usd) AS "Volume",
    ROW_NUMBER() OVER (
    ORDER BY
    COUNT(DISTINCT tx_hash) DESC,
    SUM(amount_in_usd) DESC
    ) AS rn
    FROM
    ethereum.defi.ez_dex_swaps
    WHERE
    block_timestamp BETWEEN '2024-10-01'
    AND '2024-10-31'
    AND platform IS NOT NULL
    QueryRunArchived: QueryRun has been archived