cypherNet daily eth added to liquidity pools on Uniswap
Updated 2022-09-17
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
›
⌄
with increase as (select
date_trunc('day', block_timestamp) as day,
sum(iff(token0_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', amount0_adjusted, amount1_adjusted)) as eth_added
from ethereum.uniswapv3.ez_lp_actions
where (token0_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
or token1_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2')
and action = 'INCREASE_LIQUIDITY'
and day >= current_date() - 30
group by day),
remove as (select
date_trunc('day', block_timestamp) as day,
sum(iff(token0_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', amount0_adjusted, amount1_adjusted)) as eth_removed
from ethereum.uniswapv3.ez_lp_actions
where (token0_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
or token1_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2')
and action = 'DECREASE_LIQUIDITY'
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