biffbusterweekly_rebalance_share
Updated 2023-06-20
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
›
⌄
-- forked from vault_rebalances @ https://flipsidecrypto.xyz/edit/queries/34afb533-364b-4819-8406-6a4bc2233030
with pool as (
SELECT
date_trunc('week',block_timestamp) as day,
pool_name,
-- action,
token0_symbol,
token1_symbol,
COUNT(DISTINCT tx_hash) as p_txns,
COUNT(DISTINCT liquidity_provider) AS p_lps,
COUNT(DISTINCT nf_position_manager_address) as p_pm,
SUM(amount0_adjusted) as t0_pool_adjusted,
SUM(amount1_adjusted) as t1_pool_adjusted
FROM (
SELECT
f.block_timestamp,
f.tx_hash,
f.pool_name,
f.action,
f.liquidity_provider,
f.nf_position_manager_address,
f.token0_symbol,
f.token1_symbol,
f.amount0_adjusted,
f.amount1_adjusted
FROM ethereum.uniswapv3.ez_lp_actions f
WHERE f.pool_address = LOWER('{{pool_address}}')
ORDER BY 1 DESC
)
GROUP BY 1,2,3,4
ORDER BY 1 DESC
),
vault as (
Run a query to Download Data