maybeyonasthor_debut_liq
Updated 2022-05-15
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
›
⌄
with
first_swap as (
select
split(pool_name,'-')[0]::string as pool,
min(block_timestamp) as first_swap
from thorchain.swaps
group by 1
),
liq_24 as (
select
day,
pool,
first_swap,
asset_price_usd,
asset_liquidity*asset_price_usd as asset_liq,
rune_liquidity*rune_price_usd as rune_liq,
asset_liq+rune_liq as total_liq
from thorchain.daily_pool_stats join first_swap on split(pool_name,'-')[0]::string=pool
where timediff(week, first_swap, day) <= 7
)
-- select * from thorchain.daily_pool_stats
-- limit 100
select *,
rank() over(partition by pool order by day) as rank
from liq_24
order by total_liq desc
-- limit 100
Run a query to Download Data