crypto_gostTotal swaps volume
    Updated 2024-12-28
    WITH swap_events AS (
    SELECT
    block_timestamp,
    tx_hash,
    ORIGIN_FROM_ADDRESS AS user_address,
    nvl(amount_in_usd, amount_out_usd) AS amount_usd
    FROM avalanche.defi.ez_dex_swaps
    where platform ilike '%pharaoh%'
    AND block_timestamp >= current_date - INTERVAL '60 days'
    ),
    user_swap_counts AS (
    SELECT
    user_address,
    COUNT(*) AS swap_count
    FROM
    swap_events
    GROUP BY
    user_address
    )
    SELECT
    (SELECT COUNT(DISTINCT user_address) FROM swap_events) AS total_swappers_last_60_days,
    COUNT(DISTINCT CASE WHEN swap_count > 5 THEN user_address END) AS active_users_last_60_days,
    AVG(swap_count) AS avg_swaps_per_user_last_60_days,
    SUM(swap_count) AS total_swaps_last_60_days
    FROM
    user_swap_counts;
    Last run: about 2 months ago
    TOTAL_SWAPPERS_LAST_60_DAYS
    ACTIVE_USERS_LAST_60_DAYS
    AVG_SWAPS_PER_USER_LAST_60_DAYS
    TOTAL_SWAPS_LAST_60_DAYS
    1
    20963290829.205743612240
    1
    31B
    2s