Moe2dxosmdx
Updated 2022-11-17
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
›
⌄
with prices as (
select
RECORDED_AT::date as days , SYMBOL,
avg(price) as prices
from
osmosis.core.dim_prices
where provider = 'coinmarketcap'
group by 1 ,2
)
,base as (
select
l.*, PROJECT_NAME as LABEL
from
osmosis.core.fact_liquidity_provider_actions l , osmosis.core.dim_labels b
where CURRENCY = b.ADDRESS
)
,fin as (
select
b.*,prices,AMOUNT/pow(10,decimal) as AMOUNTs ,
AMOUNTs*prices as AMOUNT_usd
from
base b,prices p
where
BLOCK_TIMESTAMP::date = days and LABEL = SYMBOL and LABEL not ilike 'inj'
and AMOUNT is not null)
select
block_timestamp::date as days,action,
iff(block_timestamp::date < '2022-11-08','pre-FTX bankruptcy ','post-FTX bankruptcy' ) as daytype,
count (distinct tx_id) as LPing,
sum(LPing)over(partition by action order by days rows between unbounded preceding and current row ) as cumulative_swaps,
count (distinct LIQUIDITY_PROVIDER_ADDRESS) as users,
Run a query to Download Data