shawnedwardsdaily deposit and withdraw
    Updated 2023-06-05
    with deposit as
    (SELECT block_timestamp::date as daily,
    count (distinct depositor_address) as depositor_count,
    count(distinct tx_hash) as deposit_transaction_count,
    coalesce(sum(issued_tokens),0) as amount_deposit,
    coalesce(sum(supplied_usd),0) as deposit_amount_usd,
    deposit_amount_usd/deposit_transaction_count as USD_amount_per_deposit
    from ethereum.aave.ez_deposits
    where block_timestamp::date >= '2023-01-01'
    and block_timestamp::date <= getdate() - interval'1 day'
    and SYMBOL = 'AAVE'
    group by 1),
    withdraw as
    (SELECT block_timestamp::date as daily,
    count (distinct depositor_address) as withdrawer_count,
    count(distinct tx_hash) as withdraw_transaction_count,
    coalesce(sum(withdrawn_tokens),0) as amount_withdraw,
    coalesce(sum(withdrawn_usd),0) as withdraw_amount_usd,
    withdraw_amount_usd/withdraw_transaction_count as USD_amount_per_withdraw
    from
    ethereum.aave.ez_withdraws
    where block_timestamp::date >= '2023-01-01'
    and block_timestamp::date <= getdate() - interval'1 day'
    and SYMBOL = 'AAVE'
    group by 1)
    select deposit.daily,depositor_count,
    withdrawer_count, deposit_transaction_count, amount_deposit,deposit_amount_usd, withdraw_transaction_count, amount_withdraw,
    withdraw_amount_usd, USD_amount_per_deposit, USD_amount_per_withdraw
    from deposit, withdraw where deposit.daily = withdraw.daily
    Run a query to Download Data