LUNA Market Cap
Q201. Back to basics! Display the LUNA price and market cap trend over 30, 60, 90 days; the past year; and all time.
Introduction
This dashboard will analyse the LUNA price and the market cap trends for different timeframes. Let's explore these two widespread metrics in crypto for the rising star Terra's native token.
But first we need to define some concepts:
-
Price: is self explanatory. For the calculations, I will use the average daily price as well as the minimum and maximum intraday value at which the token was exchanged in USD.
-
Market cap: the usual definition states market capitalization is the circulating supply of a token times the price. But how to calculate circulating supply? According to Terra Analytics by Smart Stake, circulating supply includes bonded LUNA and does not include community spend and oracle rewards. Since the data in the linked dashboard matches the figure in CoinMarketCap and Coingecko, I will use this definition as well.
Methodology
The approach here is two fold:
-
Price: the min, max and average price will be calculated, aggregated by day, from the
terra.oracle_prices
table. -
Market Cap: first, the circulating supply will be calculated separatedly with two CTEs for staked and liquid LUNA using the
terra.daily_balances
table as the sum of balances in all addresses. These CTE will then be joined with the price information and the market cap will be calculated each day as circulating supply times avg daily price. Some addresses will be explicitly excluded based on p_crypto_0 Dashboard:terra1gr0xesnseevzt3h4nxr64sh5gk4dwrwgszx3nw
--> LUNA Foundation Guard (LFG)terra1dp0taj85ruc299rkdvzp4z5pfg6z6swaed74e6
--> Terraforms Labs (TFL)terra1wqmfu6w725sal3nvr0ggy49mmtwqgc6tyf4anp
--> Luna Incentives Distribution Addressterra1jgp27m8fykex4e4jtt0l7ze8q528ux2lh4zh0f
--> Oracle Rewards Core Moduleterra1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8pm7utl
--> Account Distribution Core Moduleterra1tygms3xhhs3yv487phx3dw4a95jn7t7l8l07dr
--> Not Bonded Tokens Pool Core Module
For the 30,60 and 90 days timeframes I will use one query with a parameter for the number of days.
For the past year, another query will be used between January 1st and December 31st, 2021 calculating the weekly average price and circulating supply.
For the all-time calculations, the data from before 2021, 2021 and 2022 was queried separatedly with the above structure and the csv data were merged with a datasheet because of query runtime errors with no time filtering - probably my code is not optimised enough.
Figure 1. shows the LUNA price (daily min, max and average) and market cap. By default it will show last 90 days - parameter can be adjusted on the top of the dashboard. Both metrics show an uptrend in March but entered a correction in April amidst a general crypto down market. On May 7th the
Figure 2. shows the weekly min, max and average of LUNA price and average market cap throughout 2021. It was an incredible performance reaching to 30B USD Market Cap from under 500M USD with a price appreciation of over 100x.
Figure 3. shows the all-time weekly min, max and average of LUNA price and average market cap. It shows two differentiated trends - one prior to 2021 where slope is very flat and the accelerated slope especially from July 2021 (when taking the local lows). If this accelerated low slope acts as a support for the current downtrend, it can be seen as a long needed correction after the March 2022 ATH.
Figure 4. is the same data with a log-scale on Y-axis.