mcfemi6TOTAL TRANSACTION (BORROW & SUPPLY)

    Select
    Count(DISTINCT BORROWER_ADDRESS) AS TOTAL_BORROWER,
    BORROWER_ADDRESS,
    sum(BORROWED_USD),
    Count(DISTINCT DEPOSITOR_ADDRESS) AS TOTAL_DEPOSITOR,
    sum(SUPPLIED_USD),
    DEPOSITOR_ADDRESS
    FROM ethereum.aave.ez_borrows Borrow
    JOIN ethereum.aave.ez_deposits Deposit
    ON Borrow.aave_version = deposit.aave_version
    WHERE borrow.AAVE_VERSION = 'Aave V2' AND deposit.AAVE_VERSION = 'Aave V2'
    GROUP BY 2,5 ORDER BY 2 DESC;



    --Please give the total transaction activity (Borrow & Supply) for unique users in Aave V2 (Ethereum)
    Select
    Count(DISTINCT BORROWER_ADDRESS) AS TOTAL_BORROWER,
    Count(DISTINCT DEPOSITOR_ADDRESS) AS TOTAL_DEPOSITOR
    FROM ethereum.aave.ez_borrows Borrow
    JOIN ethereum.aave.ez_deposits Deposit
    ON Borrow.aave_version = deposit.aave_version
    WHERE borrow.AAVE_VERSION = 'Aave V2' AND deposit.AAVE_VERSION = 'Aave V2'


    Select
    Count(DISTINCT BORROWER_ADDRESS) AS TOTAL_BORROWER,
    Count(DISTINCT DEPOSITOR_ADDRESS) AS TOTAL_DEPOSITOR
    FROM ethereum.aave.ez_borrows Borrow
    JOIN ethereum.aave.ez_deposits Deposit
    ON Borrow.aave_version = deposit.aave_version
    WHERE deposit.aave_version != 'Aave V1' AND Borrow.aave_version = 'Aave V2'


    Select *
    Run a query to Download Data