superflyUntitled Query
Updated 2023-01-11Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
›
⌄
with supply as (SELECT
block_id,
total_supply/pow(10,24) as total_supply,
(chunks[0]:balance_burnt + chunks[1]:balance_burnt + chunks[2]:balance_burnt + chunks[3]:balance_burnt)/pow(10,24) as amount_burned
FROM near.core.fact_blocks
ORDER BY 1 DESC
)
SELECT
total_supply - total_burned as total_supply
FROM (SELECT round(total_supply, 0) as total_supply,
round(sum(amount_burned) over(), 0) as total_burned
FROM supply
ORDER BY 1 DESC
LIMIT 1
)
Run a query to Download Data