barbodAround & Around We Go
Updated 2022-02-24
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
›
⌄
with Circulating_Supply as (
select date::date as date , sum(BALANCE) as Luna_Circulating_Supply
,sum(BALANCE_USD) as Luna_Circulating_Supply_USD
from terra.daily_balances
where date>= CURRENT_DATE-90
and BALANCE_TYPE='liquid'
and CURRENCY='LUNA'
-- and address != 'terra1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3nln0mh'
and address_label is null
and
balance > 0
and BALANCE_USD is not NULL
group by 1 order by 1
),
Luna_price as (
select
block_timestamp::date as date,
avg(price_usd) as LUNA_PRICE
from terra.oracle_prices
where symbol = 'LUNA'
and block_timestamp >= CURRENT_DATE-90
group by 1
)
select Circulating_Supply.date as date , Luna_Circulating_Supply , LUNA_PRICE , Luna_Circulating_Supply_USD
from Circulating_Supply join Luna_price
on Luna_price.date = Circulating_Supply.date
group by 1,2,3,4
Run a query to Download Data