keshanOpyn q1 - 2
    Updated 2022-06-30
    with inward as (
    select block_timestamp::date as date, count(distinct ETH_FROM_ADDRESS) as senders,
    sum(amount) as in_eth, sum(amount_usd) as in_usd_value, count(distinct tx_hash) as in_txs
    from ethereum.core.ez_eth_transfers
    where eth_to_address=lower('0x64187ae08781B09368e6253F9E94951243A493D5')
    group by date
    ),
    outward as (
    select block_timestamp::date as date, count(distinct ETH_TO_ADDRESS) as receivers,
    sum(amount) as out_eth, sum(amount_usd) as out_usd_value, count(distinct tx_hash) as out_txs
    from ethereum.core.ez_eth_transfers
    where eth_from_address=lower('0x64187ae08781B09368e6253F9E94951243A493D5')
    group by date
    )

    select i.date, senders, in_eth, in_usd_value, in_txs, receivers,
    -1 * out_eth as out_eth, -1 * out_usd_value as out_usd_value, out_txs, in_eth - out_eth as net_eth,
    in_usd_value - out_usd_value as net_usd
    from inward i full join outward o using(date)

    Run a query to Download Data