datavortextotals 2
    Updated 2024-12-13
    WITH trader_volumes AS (
    SELECT
    s.trader,
    SUM(s.amount_in_usd) AS total_volume,
    COUNT(DISTINCT s.tx_hash) AS total_swaps
    FROM
    near.defi.ez_dex_swaps s
    WHERE
    s.block_timestamp >= '2024-01-01'
    AND s.block_timestamp <= '2024-12-31'
    GROUP BY
    s.trader
    ),
    categorized_traders AS (
    SELECT
    trader,
    total_volume,
    total_swaps,
    CASE
    WHEN total_volume > 10000 AND total_volume <= 99999 THEN 'Dolphins'
    ELSE 'Other'
    END AS trader_category
    FROM
    trader_volumes
    )
    SELECT
    COUNT(DISTINCT trader) AS total_dolphins,
    SUM(total_swaps) AS total_swaps_by_dolphins,
    SUM(total_volume) AS total_volume_by_dolphins
    FROM
    categorized_traders
    WHERE
    trader_category = 'Dolphins';

    Last run: 10 days ago
    TOTAL_DOLPHINS
    TOTAL_SWAPS_BY_DOLPHINS
    TOTAL_VOLUME_BY_DOLPHINS
    1
    332762457393658918.2268928
    1
    32B
    580s