Afonso_DiazComparison
    Updated 2024-12-05

    with

    main as (
    select
    tx_hash,
    block_timestamp,
    borrower as user,
    token_symbol as symbol,
    amount_usd,
    'Borrow' as event_name,
    trim(replace(replace(replace(platform, 'V1', ''), 'V2', ''), 'V3', '')) as platform,
    from
    arbitrum.defi.ez_lending_borrows
    where
    amount_usd <1e6

    union all

    select
    tx_hash,
    block_timestamp,
    depositor as user,
    token_symbol as symbol,
    amount_usd,
    'Deposit' as event_name,
    trim(replace(replace(replace(platform, 'V1', ''), 'V2', ''), 'V3', '')) as platform,
    from
    arbitrum.defi.ez_lending_deposits
    where
    amount_usd <1e6

    union all

    select
    tx_hash,
    QueryRunArchived: QueryRun has been archived