shreyash-5873Terra: LUNA burnt in USD
Updated 2021-08-04
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
›
⌄
with luna_prices as (
select
date(block_timestamp) as block_date,
avg(price_usd) as avg_price_usd
from terra.oracle_prices
where symbol = 'LUNA'
group by 1
),
native_luna_burnt as (select
date(block_timestamp) as block_date,
sum(token_0_amount) as daily_luna_burnt,
sum(token_0_amount_usd) as daily_luna_burnt_usd
from terra.swaps
where token_0_currency = 'LUNA'
group by 1
order by 1 desc, 2 desc),
native_ust_burnt as (select
date(block_timestamp) as block_date,
sum(token_0_amount) as daily_ust_burnt,
sum(token_0_amount_usd) as daily_ust_burnt_usd
from terra.swaps
where token_0_currency = 'UST'
and token_1_currency = 'LUNA'
group by 1
)
select
*
from native_luna_burnt l
inner join native_ust_burnt u
on l.block_date = u.block_date
inner join luna_prices p
on l.block_date = p.block_date
where l.block_date >= current_date() - 14
Run a query to Download Data