shadilLUNA Market Cap - 90days
Updated 2022-05-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
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with
mcap_tbl as (
select balance, address, date
from terra.daily_balances
where (balance_type = 'liquid')
and address != 'terra1gr0xesnseevzt3h4nxr64sh5gk4dwrwgszx3nw' and address != 'terra1dp0taj85ruc299rkdvzp4z5pfg6z6swaed74e6' and address !='terra1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3nln0mh' and address != 'terra1wqmfu6w725sal3nvr0ggy49mmtwqgc6tyf4anp' and address != 'terra1jgp27m8fykex4e4jtt0l7ze8q528ux2lh4zh0f' and address != 'terra1mtwph2juhj0rvjz7dy92gvl6xvukaxu8rfv8ts' and address != 'terra1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8pm7utl' and address != 'terra1tygms3xhhs3yv487phx3dw4a95jn7t7l8l07dr'
and currency = 'LUNA'
and date >= DATEADD(DAY, -90, GETDATE())
UNION
select balance , address, date
from terra.daily_balances
where (balance_type = 'staked')
and address != 'terra1gr0xesnseevzt3h4nxr64sh5gk4dwrwgszx3nw' and address != 'terra1dp0taj85ruc299rkdvzp4z5pfg6z6swaed74e6' and address !='terra1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3nln0mh' and address != 'terra1wqmfu6w725sal3nvr0ggy49mmtwqgc6tyf4anp' and address != 'terra1jgp27m8fykex4e4jtt0l7ze8q528ux2lh4zh0f' and address != 'terra1mtwph2juhj0rvjz7dy92gvl6xvukaxu8rfv8ts' and address != 'terra1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8pm7utl' and address != 'terra1tygms3xhhs3yv487phx3dw4a95jn7t7l8l07dr'
and currency = 'LUNA'
and date >= DATEADD(DAY, -90, GETDATE())
),
LUNA_PRICE AS (
SELECT
DATE(block_timestamp) as date,
AVG(price_usd) as luna_price
FROM terra.oracle_prices
WHERE symbol = 'LUNA'
and date >= DATEADD(DAY, -90, GETDATE())
GROUP BY date
)
SELECT SUM(balance) as supply, date, avg(luna_price) as price, supply * price as mcap
FROM
(
SELECT balance, address, c.date, p.luna_price
from mcap_tbl c
INNER JOIN LUNA_PRICE p on c.date = p.date
)
Run a query to Download Data