MLDZMNeth1
    Updated 2023-04-29
    with deposit as (select
    count(distinct tx_hash) as no_txn,
    count(distinct ETH_FROM_ADDRESS) as no_users,
    sum(amount) as deposit,
    sum(AMOUNT_USD) as deposit_usd,
    avg(AMOUNT_USD) as average_depsoit,
    no_users/count(distinct date_trunc(day, block_timestamp)) as average_user_day

    from ethereum.core.ez_eth_transfers
    where ETH_TO_ADDRESS= lower('0xCBD6832Ebc203e49E2B771897067fce3c58575ac')

    ),


    withdraw as (select
    count(distinct tx_hash) as no_txn1,
    count(distinct ETH_TO_ADDRESS) as no_users1,
    sum(amount) as withdraw,
    sum(AMOUNT_USD) as withdraw_usd,
    avg(AMOUNT_USD) as average_withdraw

    from ethereum.core.ez_eth_transfers
    where ETH_FROM_ADDRESS= lower('0xCBD6832Ebc203e49E2B771897067fce3c58575ac')
    )



    select
    deposit,
    withdraw,
    deposit_usd,
    withdraw_usd,
    deposit-withdraw as net_deposit,
    deposit_usd-withdraw_usd as net_deposit_usd,
    average_depsoit,
    average_withdraw,
    Run a query to Download Data