Elprognerd1 - overall d&w
    Updated 2023-06-05
    with t1 as(select date_trunc('month',BLOCK_TIMESTAMP) as date,
    'Deposit' as action,
    ISSUED_TOKENS as amount,
    DEPOSITOR_ADDRESS,
    AAVE_VERSION,
    TX_HASH
    FROM ethereum.aave.ez_deposits
    where aave_market = '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9'
    union all
    select date_trunc('month', BLOCK_TIMESTAMP) as date,
    'Withdrawal' as action,
    WITHDRAWN_TOKENS as amount,
    DEPOSITOR_ADDRESS,
    AAVE_VERSION,
    TX_HASH
    FROM ethereum.aave.ez_withdraws
    where aave_market = '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9')


    SELECT
    action,
    sum(amount) as "Total volume",
    avg(amount) as "Average volume per TXN",
    count(DISTINCT TX_HASH) as "Number of transactions",
    count(DISTINCT DEPOSITOR_ADDRESS) as "Number of unique addresses",
    "Total volume"/"Number of unique addresses" as "Volume per user"
    from t1
    GROUP BY 1

    Run a query to Download Data