elvisThor10.2 - Pool TVL comparison 10.18 - today
Updated 2021-11-01
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
⌄
/* What is the volume of each pool by TVL? How does that compare to the depth of each pool in terms of the unique number of liquidity providers?
Hint: use daily_pool_stats + liquidity_actions*/
WITH TVL_before AS(
SELECT
pool_name as pool, day as dt, asset_liquidity * asset_price_usd as asset_liquidity_usd, rune_liquidity * rune_price_usd as rune_liquidity_usd, rune_liquidity_usd+asset_liquidity_usd as tvl_usd,
rune_liquidity_usd - asset_liquidity_usd as pool_imbalance
FROM thorchain.daily_pool_stats
WHERE
dt = '2021-10-18 00:00:00' AND tvl_usd != 0
)
SELECT pool, tvl_usd_today, tvl_usd_1018, (tvl_usd_today/tvl_usd_1018 -1)*100 as Percentage_increase
FROM (
SELECT
N.asset_liquidity * N.asset_price_usd as asset_liquidity_usd_today, N.rune_liquidity * N.rune_price_usd as rune_liquidity_usd_today,
N.pool_name as pool, rune_liquidity_usd_today+asset_liquidity_usd_today as tvl_usd_today, B.tvl_usd as tvl_usd_1018
FROM thorchain.daily_pool_stats AS N INNER JOIN TVL_before AS B
ON N.pool_name = B.pool
WHERE
N.day = CURRENT_DATE AND tvl_usd_today != 0
)
ORDER BY tvl_usd_today DESC
Run a query to Download Data