mohammadhCosmoverse Free Play 8)
Updated 2022-10-11
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
›
⌄
select
'pool_joined' as type,
date_trunc('day', block_timestamp) as block_day,
sum(AMOUNT/1e6) as volume,
count (distinct LIQUIDITY_PROVIDER_ADDRESS) as user_count,
count(distinct TX_ID) as tx_count,
sum(volume) over ( order by block_day asc) as flow_volume,
sum(user_count) over (order by block_day asc) as flow_user,
sum(tx_count) over ( order by block_day asc) as flow_tx,
avg(AMOUNT/1e6) as avg_volume
from osmosis.core.fact_liquidity_provider_actions
where CURRENCY='ibc/0954E1C28EB7AF5B72D24F3BC2B47BBB2FDF91BDDFD57B74B99E133AED40972A'
and (block_day >= '2022-10-01' and block_day <= '2022-10-10')
and TX_STATUS ='SUCCEEDED'
and ACTION ='pool_joined'
group by block_day
union all
select
'pool_exited' as type,
date_trunc('day', block_timestamp) as block_day,
sum(AMOUNT/1e6)*-1 as volume,
count (distinct LIQUIDITY_PROVIDER_ADDRESS)*-1 as user_count,
count(distinct TX_ID)*-1 as tx_count,
sum(volume) over ( order by block_day asc) as flow_volume,
sum(user_count) over (order by block_day asc) as flow_user,
sum(tx_count) over (order by block_day asc) as flow_tx,
avg(AMOUNT/1e6) as avg_volume
from osmosis.core.fact_liquidity_provider_actions
where CURRENCY='ibc/0954E1C28EB7AF5B72D24F3BC2B47BBB2FDF91BDDFD57B74B99E133AED40972A'
and (block_day >= '2022-10-01' and block_day <= '2022-10-10')
and TX_STATUS ='SUCCEEDED'
and ACTION ='pool_exited'
group by block_day
Run a query to Download Data