headitmanager10incen
Updated 2023-02-13
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
›
⌄
with volume_in as (select sum(amount/pow(10,decimal)) as volume_in , to_date(block_timestamp::date) as date_in , case
when pool_id[0] = 899 then 'wAVAX / OSMO'
when pool_id[0] = 840 then 'wBNB / OSMO'
when pool_id[0] = 704 then 'wETH / OSMO'
when pool_id[0] = 789 then 'wMATIC / OSMO'
end as pools
from osmosis.core.fact_liquidity_provider_actions
where action ilike 'pool_joined' and pool_id[0] in(899,840,704,789) and date_in > '2022-11-01'
group by date_in , pools)
, volume_out as (select sum(amount/pow(10,decimal)) as volume_out , to_date(block_timestamp::date) as date_out , case
when pool_id[0] = 899 then 'wAVAX / OSMO'
when pool_id[0] = 840 then 'wBNB / OSMO'
when pool_id[0] = 704 then 'wETH / OSMO'
when pool_id[0] = 789 then 'wMATIC / OSMO'
end as pools
from osmosis.core.fact_liquidity_provider_actions
where action ilike 'pool_exited' and pool_id[0] in(899,840,704,789) and date_out > '2022-11-01'
group by date_out , pools)
select volume_in , volume_out , date_in , volume_in.pools from volume_in left join volume_out
on date_in=date_out and volume_in.pools=volume_out.pools
Run a query to Download Data