i_danLending All Total
    Updated 2024-11-08
    WITH total AS (
    SELECT
    'Deposit' AS type
    , COUNT(DISTINCT Platform) AS Platform_count
    , COUNT(DISTINCT token_symbol) AS token_count
    , 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
    'Withdrawal' AS type
    , COUNT(DISTINCT Platform) AS Platform_count
    , COUNT(DISTINCT token_symbol) AS token_count
    , SUM(amount_usd) AS volume
    , COUNT(DISTINCT origin_from_address) AS users
    , COUNT(tx_hash) AS transactions
    FROM base.defi.ez_lending_withdraws
    UNION ALL
    SELECT
    'Borrow' AS type
    , COUNT(DISTINCT Platform) AS Platform_count
    , COUNT(DISTINCT token_symbol) AS token_count
    , SUM(amount_usd) AS volume
    , COUNT(DISTINCT origin_from_address) AS users
    , COUNT(tx_hash) AS transactions
    FROM base.defi.ez_lending_borrows
    UNION ALL
    SELECT
    'Repay' AS type
    QueryRunArchived: QueryRun has been archived