i_danLending Deposit and Withdrawal
    Updated 2024-11-08
    WITH weekly AS (
    SELECT
    'deposit' AS type
    , SUM(amount_usd) AS volume
    , COUNT(DISTINCT origin_from_address) AS users
    , COUNT(tx_hash) AS transactions
    from base.defi.ez_lending_deposits
    UNION ALL
    SELECT
    'withdraw' AS type
    , SUM(amount_usd) AS volume
    , COUNT(DISTINCT origin_from_address) AS users
    , COUNT(tx_hash) AS transactions
    from base.defi.ez_lending_withdraws
    )

    SELECT
    type
    , SUM(volume) AS volume
    , SUM(users) AS users
    , SUM(transactions) AS transactions
    FROM weekly
    GROUP BY 1
    ORDER BY 2 DESC


    QueryRunArchived: QueryRun has been archived