Nige777746 Bonded vs unbonded 1
Updated 2021-08-18
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 cte_1 as (
select distinct
SUM(BALANCE) OVER (partition by Balance_type, date order by date) AS LUNA,
SUM(BALANCE) OVER (partition by date order by date) AS TOTAL_SUPPLY,
IFF(Balance_type = 'liquid','LUNA','BLUNA') AS L_TYPE,
DATE
from terra.daily_balances
WHERE
date > CURRENT_DATE -90
and currency = 'LUNA'
and balance > 0
and balance_type ='liquid'
and address != lower('terra1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3nln0mh')
),
cte_2 as (
select distinct
SUM(BALANCE) OVER (partition by Balance_type, date order by date) AS bLUNA,
SUM(BALANCE) OVER (partition by date order by date) AS b_TOTAL_SUPPLY,
IFF(Balance_type = 'liquid','LUNA','BLUNA') AS B_TYPE,
DATE as B_DATE
from terra.daily_balances
WHERE
date > CURRENT_DATE -90
and currency = 'LUNA'
and balance > 0
and balance_type ='staked'
and address != lower('terra1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3nln0mh')
Run a query to Download Data