Specterdistribution of tx
    Updated 2025-03-10
    WITH okx_aggregator_swaps AS (
    SELECT
    block_timestamp,
    tx_hash,
    origin_from_address AS swapper,
    symbol_in,
    symbol_out,
    platform,
    COALESCE(amount_in_usd, amount_out_usd) AS swap_amount_usd
    FROM avalanche.defi.ez_dex_swaps
    WHERE origin_to_address = '0x1dac23e41fc8ce857e86fd8c1ae5b6121c67d96d'
    AND block_timestamp >= '2024-01-01'
    AND swap_amount_usd is not null
    ),
    swapper_count AS (
    SELECT
    swapper,
    count(distinct tx_hash) AS tx_count,
    SUM(swap_amount_usd) AS total_volume
    FROM okx_aggregator_swaps
    GROUP BY swapper
    )

    SELECT
    CASE
    WHEN tx_count = 1 THEN '1 Transaction'
    WHEN tx_count = 2 THEN '2 Transactions'
    WHEN tx_count BETWEEN 3 AND 5 THEN '3-5 Transactions'
    WHEN tx_count BETWEEN 6 AND 10 THEN '6-10 Transactions'
    ELSE '>10 Transactions'
    END AS tx_count_category,
    COUNT(swapper) AS num_swappers
    FROM swapper_count
    GROUP BY tx_count_category
    ORDER BY num_swappers DESC;

    Last run: about 2 months ago
    TX_COUNT_CATEGORY
    NUM_SWAPPERS
    1
    1 Transaction29621
    2
    2 Transactions9308
    3
    3-5 Transactions6693
    4
    >10 Transactions3350
    5
    6-10 Transactions2537
    5
    128B
    8s