messariAmount of Luna Burned (to Q1 2021)
Updated 2022-04-28Copy Reference Fork
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
›
⌄
-- Tarik - revised from query by kenshinrhonin https://app.flipsidecrypto.com/dashboard/pleasure-to-burn-BF0Lxs
WITH luna_bunts as (
select
date_trunc('day' , block_timestamp) as day ,
sum(token_0_amount) burnt_luna,
sum(burnt_luna) over (ORDER BY day) as cum_burnt
from terra.swaps
where ask_currency = 'UST'
and offer_currency = 'LUNA'
and tx_status = 'SUCCEEDED'
group by 1
),
luna_supply as (
SELECT
date_trunc('day', date) as day,
SUM(balance) as luna_cs
FROM terra.daily_balances
WHERE currency = 'LUNA'
AND address_label_subtype is null
AND balance > 0
GROUP BY 1
)
SELECT
luna_bunts.day,
luna_bunts.burnt_luna,
luna_bunts.cum_burnt,
luna_supply.luna_cs
FROM luna_bunts
LEFT OUTER JOIN luna_supply
ON luna_bunts.day = luna_supply.day
Run a query to Download Data