KuramaDaily Minted UST
Updated 2022-07-07
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 ust_burned as(
SELECT TO_DATE(block_timestamp) AS date,
SUM (token_0_amount) AS ust_burned
FROM terra.swaps
WHERE TO_DATE(block_timestamp) >= dateadd(day, -60, current_date())
AND offer_currency = 'UST'
AND tx_status = 'SUCCEEDED'
GROUP BY 1
ORDER BY 1
),
ust_minted as (SELECT TO_DATE(block_timestamp) AS date,
SUM (token_1_amount) as ust_minted
FROM terra.swaps
WHERE TO_DATE(block_timestamp) >= dateadd(day, -60, current_date())
AND ask_currency = 'UST'
AND tx_status = 'SUCCEEDED'
GROUP BY 1
ORDER BY 1 ),
daily as (select a.date, a.ust_burned, b.ust_minted, (ust_minted - ust_burned) as daily_amount_minted from ust_burned a
left join ust_minted b
on a.date = b.date )
select a.*, sum(daily_amount_minted) over (order by date) as cumulative_minted from daily a
Run a query to Download Data