dannerUntitled Query
    Updated 2021-09-17
    with functions as
    (select
    concat(origin_function_name,' ',symbol) as function_symbol,
    sum(amount) amount
    from
    ethereum.udm_Events
    where tx_id in
    (select
    tx_id
    from
    ethereum.events_emitted
    where (tx_to_address = lower('0xDC24316b9AE028F1497c275EB9192a3Ea0f67022')
    or tx_from_address = lower('0xDC24316b9AE028F1497c275EB9192a3Ea0f67022'))) -- sETH - ETH Pool
    group by function_symbol)

    select
    sum(case when function_symbol ='add_liquidity ETH' then amount end) - sum(case when function_symbol in ('remove_liquidity ETH','remove_liquidity_one_coin ETH') then amount end) eth_net,
    sum(case when function_symbol = 'add_liquidity stETH' then amount end) - sum(case when function_symbol in ('remove_liquidity stETH','remove_liquidity_one_coin stETH') then amount end) steth_net

    from
    functions

    Run a query to Download Data