PapasotLiquidity: USD Volume Per Pool - Daily
Updated 2022-01-16
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
29
30
31
32
33
34
35
36
›
⌄
-- This query shows total liquidity being deposited and withdrawn from each individual Uniswap V3 Pools each day
WITH liquidity_pool AS (
SELECT
tx_id,
date_trunc('day', block_timestamp) AS date,
action,
pool_address,
pool_name,
token0_address,
token1_address,
token0_symbol,
token1_symbol,
amount0_adjusted,
amount1_adjusted,
amount0_usd,
amount1_usd,
(amount0_usd + amount1_usd) AS add_amount_total
FROM uniswapv3.lp_actions
),
add_liquidity AS (
SELECT
date,
pool_address,
pool_name,
SUM(add_amount_total) AS total_deposit
FROM liquidity_pool
WHERE action = 'INCREASE_LIQUIDITY'
GROUP BY 1,2,3
),
remove_liquidity AS (
SELECT
date,
pool_address,
pool_name,
-SUM(add_amount_total) AS total_withdrawl
FROM liquidity_pool
Run a query to Download Data