0-MIDCopy of mm
Updated 2022-10-26
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
›
⌄
with act1 as(
with tab1 as (
select date_trunc('month',RECORDED_AT)as month,SYMBOL,avg(PRICE)as t_price
from osmosis.core.dim_prices
group by 1,2),
tab2 as (
select ADDRESS,PROJECT_NAME
from osmosis.core.dim_labels)
select month,ADDRESS,t_price
from tab1
left join tab2
on tab1.SYMBOL=tab2.PROJECT_NAME),
act2 as (
select POOL_ID,CURRENCY,sum(AMOUNT/pow(10,decimal))as lp_usd_out
from osmosis.core.fact_liquidity_provider_actions
where ACTION='pool_exited'
group by 1,2)
select POOL_ID , sum(lp_usd_out) as outflow_usd
from act1
left join act2
on act1.ADDRESS=act2.CURRENCY
where lp_usd_out is not null
group by 1
Run a query to Download Data