cyphercompound net eth deposited
    Updated 2022-09-17
    with increase as (select
    date_trunc('day', block_timestamp) as day,
    sum(SUPPLIED_BASE_ASSET) as eth_added
    from ethereum.compound.ez_deposits
    where supplied_symbol = 'ETH'
    and day >= current_date() - 30
    group by day),

    remove as (select
    date_trunc('day', block_timestamp) as day,
    sum(received_amount) as eth_removed
    from ethereum.compound.ez_redemptions
    where RECEIVED_CONTRACT_SYMBOL = 'ETH'
    and day >= current_date() - 30
    group by day)

    select
    i.day,
    i.eth_added,
    r.eth_removed,
    i.eth_added - r.eth_removed as net_eth_added
    from increase i, remove r
    where i.day = r.day
    Run a query to Download Data