roptanovltv_per_tick
Updated 2023-01-11
999
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
29
30
31
32
33
34
35
36
›
-- select *
-- from ethereum.uniswapv3.ez_positions
-- WHERE POOL_NAME = 'USDC-WETH 500 10'
-- order by tick_upper desc
-- limit 10
-- with t as (
-- select action ,sum(amount0_usd) as amount_usd,
-- sum(amount1_usd) as amount_eth
-- from ethereum.uniswapv3.ez_lp_actions
-- WHERE POOL_NAME = 'USDC-WETH 500 10'
-- GROUP BY 1
-- )
-- select *
-- from t
-- select action, sum(amount0_adjusted) as sum_usdc,
-- sum(amount1_adjusted) as sum_eth
-- from ethereum.uniswapv3.ez_lp_actions
-- WHERE POOL_NAME = 'USDC-WETH 500 10'
-- group by 1
-- sum(case when action = 'INCREASE_LIQUIDITY' then amount0_adjusted end)
-- with ltv as (
-- select tick_lower, tick_upper,
-- sum(case when action = 'INCREASE_LIQUIDITY' then amount0_adjusted end) - sum(case when action = 'DECREASE_LIQUIDITY' then amount0_adjusted end) as ltv_usdc,
-- sum(case when action = 'INCREASE_LIQUIDITY' then amount1_adjusted end) - sum(case when action = 'DECREASE_LIQUIDITY' then amount1_adjusted end) as ltv_eth
-- from ethereum.uniswapv3.ez_lp_actions
-- WHERE POOL_NAME = 'USDC-WETH 500 10'
-- group by 1,2),
--recursive
Run a query to Download Data