jackguystETH 1
    Updated 2023-10-07
    SELECT
    *,
    sum(CASE when event_type LIKE 'stETH Deposit' then volume else -1 * volume end) over (ORDER BY date) as cume_net_deposit,
    CASE when event_type LIKE 'stETH Deposit' then volume else -1 * volume end as net_deposit

    FROM (
    SELECT
    date_trunc('day', block_timestamp) as date,
    'stETH Deposit' as event_type,
    count(distinct tx_hash) as transactions,
    count(distinct origin_to_address) as users,
    sum(amount) as volume

    FROM ethereum.core.ez_token_transfers
    WHERE contract_address LIKE lower('0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84')
    AND from_address LIKE lower('0x0000000000000000000000000000000000000000')
    GROUP BY 1,2

    UNION

    select
    date_trunc('day', block_timestamp) as date,
    'stETH Withdaw' as event_type,
    count(distinct tx_hash) as transactions,
    count(distinct eth_to_address) as users,
    sum(amount) as volume
    from ethereum.core.ez_eth_transfers
    where eth_from_address LIKE lower('0x889edc2edab5f40e902b864ad4d7ade8e412f9b1')
    GROUP BY 1, 2
    )
    WHERE date > '2023-05-01'

    Run a query to Download Data