Afonso_Diazgrouping txns
    Updated 2024-10-25
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    borrower as user,
    token_symbol as symbol,
    amount_usd,
    'Borrow' as event_name
    from
    arbitrum.defi.ez_lending_borrows
    where
    platform ilike 'radiant%'
    and amount_usd <1e6

    union all

    select
    tx_hash,
    block_timestamp,
    depositor as user,
    token_symbol as symbol,
    amount_usd,
    'Deposit' as event_name
    from
    arbitrum.defi.ez_lending_deposits
    where
    platform ilike 'radiant%'
    and amount_usd <1e6

    union all

    select
    tx_hash,
    block_timestamp,
    QueryRunArchived: QueryRun has been archived