barbodETH 2
    Updated 2022-06-15
    WITH stake as
    (
    select
    block_timestamp::date as fecha,
    sum(amount) as ETH_staked
    from ethereum.udm_events
    where to_ADDRESS = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84'
    and fecha >= '2022-01-02'
    group by 1
    ),

    unstake as
    (
    select
    block_timestamp::date as fecha,
    sum(amount_out) as wETH_unstaked
    from ethereum.dex_swaps
    where pool_address = '0x4028daac072e492d34a3afdbef0ba7e35d8b55c4'
    and direction = 'OUT'
    and fecha >= '2022-01-02'
    group by 1
    -- 0x246ffce0a6e7eafba7830f43ab49c39071024ebf -- STETH-STETH LP - uniswap-v2 --> No entries
    -- 0xf25b9f70f7e1d9a2968b42de00efda666efb2de3 -- stETH-WETH 3000 60 UNI-V3 LP - uniswap-v3 --> No entries
    -- 0x4028daac072e492d34a3afdbef0ba7e35d8b55c4 -- STETH-WETH LP - uniswap-v2
    )

    select
    s.fecha,
    ETH_staked,
    wETH_unstaked

    from stake s
    inner join unstake u
    on s.fecha = u.fecha


    Run a query to Download Data