dannershared-teal
    Updated 2025-02-24
    with deposits as
    (
    SELECT
    depositor as address,
    token_symbol,
    sum(amount_usd) as total_deposit,
    count(tx_hash) as deposit_events
    FROM
    base.defi.ez_lending_deposits
    where platform = 'Morpho Blue' and amount_usd
    group by 1,2
    order by 3 desc
    )
    , borrows as
    (
    SELECT
    borrower as address,
    token_symbol,
    sum(amount_usd) as total_borrow,
    count(tx_hash) as borrow_events
    FROM
    base.defi.ez_lending_borrows
    where platform = 'Morpho Blue' and amount_usd
    group by 1,2
    order by 3 desc
    )
    , ens as
    (
    SELECT
    ens_domain,
    set_address,
    owner,
    expiration_timestamp,
    last_registered_timestamp,
    expired
    FROM
    QueryRunArchived: QueryRun has been archived