glass_blossomsburn LUNA!
Updated 2022-04-30
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
›
⌄
with l as(select
date_trunc('week',block_timestamp) weeks,
sum(token_0_amount) as luna_burn,
sum(luna_burn) over(order by weeks) as cumulative_luna_burn
from terra.swaps
where tx_status ='SUCCEEDED'
and swap_pair ='LUNA to UST'
group by 1),
u as (select
date_trunc('week',block_timestamp) weeks1,
symbol,
avg(price_usd) avg_ust
from terra.oracle_prices
where symbol = 'UST'
group by 1,2 )
SELECT
l.weeks,
l.luna_burn,
l.cumulative_luna_burn,
u.avg_ust
from l join u on l.weeks = u.weeks1 group by 1,2,3,4
Run a query to Download Data