Afonso_DiazRepay assets
    Updated 2025-02-23
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    borrower as user,
    token_symbol as symbol,
    amount_usd,
    case
    when platform ilike 'aave%' then 'Aave'
    else platform
    end as platform,
    'Borrow' as event_name
    from
    avalanche.defi.ez_lending_borrows

    union all

    select
    tx_hash,
    block_timestamp,
    depositor as user,
    token_symbol as symbol,
    amount_usd,
    case
    when platform ilike 'aave%' then 'Aave'
    else platform
    end as platform,
    'Deposit' as event_name,
    from
    avalanche.defi.ez_lending_deposits

    union all

    select
    QueryRunArchived: QueryRun has been archived