Afonso_DiazGrouping users
    Updated 2025-05-12
    with

    main as (
    select
    source_chain as source_chain,
    destination_chain as destination_chain,
    direction,
    symbol,
    platform,
    amount,
    amount_in_usd as amount_usd,
    sender as source_address,
    receiver as destination_address,
    iff(direction = 'inbound', destination_address, source_address) as user,
    tx_hash,
    block_timestamp
    from
    aptos.defi.ez_bridge_activity
    where
    amount_usd < 1e6
    and platform = 'layerzero'
    ),

    t3 as (
    select
    user,
    count(distinct tx_hash) as transactions,
    min(block_timestamp) as first_transaction_at
    from
    main
    group by 1
    )

    select
    case
    when transactions = 1 then 'a. 1 Transaction'
    Last run: 23 days ago
    USER_TYPE
    USERS
    1
    a. 1 Transaction449813
    2
    b. 2 - 5 Transactions615993
    3
    c. 6 - 10 Transactions94824
    4
    d. 11 - 25 Transactions41754
    5
    e. 26 - 50 Transactions5591
    6
    f. > 50 Transactions1585
    6
    192B
    2s