Updated 2025-03-04
    with

    main as (
    select
    tx_id,
    block_timestamp,
    trader as user,
    nvl(amount_in_usd, amount_out_usd) as amount_usd,
    token_in_symbol as symbol_in,
    token_out_symbol as symbol_out,
    split(platform, 'increment-')[1] as type
    from
    flow.defi.ez_dex_swaps
    where
    amount_usd <= 1e6
    and platform ilike 'increment%'
    )

    select
    type,
    count(distinct tx_id) as transactions,
    count(distinct user) as users,
    sum(amount_usd) as total_volume_usd,
    avg(amount_usd) as average_amount_usd
    from main
    group by 1
    Last run: about 1 month ago
    TYPE
    TRANSACTIONS
    USERS
    TOTAL_VOLUME_USD
    AVERAGE_AMOUNT_USD
    1
    stable
    14548160518525319.0699031115.176924507
    2
    v1
    40135444212373390.6867285205.404981602
    2
    103B
    3s