mariyaAstroport details TVL
Updated 2022-03-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
›
⌄
with lst_wallets_90 as (
select tx_from[0] as wallet
,min(block_timestamp)::date as min_date
from terra.transactions
group by 1
having min_date>=CURRENT_DATE-90
)
,lst_tx_id as (
select DISTINCT tx_id from terra.transactions
where tx_from[0] in(select wallet from lst_wallets_90)
)
,luna_bluna_price as (
select
date(block_timestamp) as date_block
, symbol
, avg(price_usd) as price_usd
from terra.oracle_prices
where symbol in ('LUNA', 'bLUNA')
group by 1,2
order by 1 desc
),
price_pivoted as (
select *
from luna_bluna_price
pivot(sum(price_usd) for symbol in ('bLUNA', 'LUNA'))
as p (date_block, bLUNA, LUNA)
order by date_block
),
terraswap_withdraw as (
-- withdraw bluna-luna pair on terraswap
select
event.block_timestamp,
event.tx_id,
-- event_attributes,
event.event_attributes:"0_from"::string as sender,
iff(event.event_attributes:refund_assets[0]:denom::string = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp', 'bLUNA', 'LUNA') as denom_0,
Run a query to Download Data