diff --git a/.gitignore b/.gitignore index 58fdc92b60c..63ed8ea8d2b 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ openbb_terminal/config_terminal.py openbb_terminal/feature_flags.py openbb_terminal/reports/stored/* openbb_terminal/dashboards/.ipynb_checkpoints +openbb_terminal/custom_reports/*/.ipynb_checkpoints openbb_terminal/reports/.ipynb_checkpoints openbb_terminal/reports/widgets/.ipynb_checkpoints !openbb_terminal/reports/stored/.gitkeep @@ -32,6 +33,7 @@ openbb_terminal/portfolio/portfolios/* *.http bots/interactive/*.html .coverage.* +!openbb_terminal/custom_reports/*/.ipynb # pyinstaller artifacts *.pyo diff --git a/openbb_terminal/custom_reports/lunar_crash/coin_highs.png b/openbb_terminal/custom_reports/lunar_crash/coin_highs.png new file mode 100644 index 00000000000..953aa4c98ae Binary files /dev/null and b/openbb_terminal/custom_reports/lunar_crash/coin_highs.png differ diff --git a/openbb_terminal/custom_reports/lunar_crash/luna_crash.html b/openbb_terminal/custom_reports/lunar_crash/luna_crash.html new file mode 100644 index 00000000000..cfefb8b0615 --- /dev/null +++ b/openbb_terminal/custom_reports/lunar_crash/luna_crash.html @@ -0,0 +1,346 @@ + + +
+ + +Analyst: Minh Hoang
+Date : 16 May, 2022
+Time : 00:46 BST
+LUNA CRASH EVENTS
+Over the past few days, we witnessed the bank run of the largest decentralized stablecoin, UST, together with the demise of LUNA. + +Its effect has spread over the entire Terra ecosystem as well as the entire crypto market. +
Just a few weeks ago, LUNA and the Terra ecosystem are still the darlings of crypto investors. +Experiencing a 20,000% increase since the beginning of 2021, LUNA reached its ATH of $119 in January 2021. +
Overall, just a few days ago, Terra was the second biggest smart contract platform in terms of total value lock, with almost $22 billion. +Its biggest dApp is Anchor, a lending and borrowing protocol with the (in)famous APY of 20%. +This lucrative return is too hard to ignore, even within the crypto market. Within a year, its TVL has shot up from $500M to almost $17.5B. +
+The bloodbath initially started with UST losing its peg against USD. +After that, both LUNA and UST have been completely destroyed. +You might be wondering, how did this happen in less than a week? +To explain this, we first have to understand the stablizing mechanism of the Terra ecosystem. + + +A centralized stablecoin such as USDT would needs actual backed assets, such as BTC, to consistently track the dollar. +As UST is a decentralized, and algorithmic stablecoin, the mint and burnt mechanism between LUNA & UST plays the crucial role in sustaining the peg. + + +In essence, Terra protocol allow its users to burn 1$ worth of LUNA to mint 1 UST and vice versa, burn UST to mint 1$ worth of LUNA. + + +This creates an arbitrage opportunity whenever UST loses its peg against the dollar. +Let’s say when UST is traded at $0.90, you can buy UST and burn it for 1$ worth of LUNA, making a profit of 10 cent. +By burning UST, UST supply would decrease and therefore, raising price back to $1 as in Economics 101. + + +The other way around, when UST is traded at $1.10, you can burn $1 worth of LUNA to mint UST. +This would flood more UST to the market, forcing price to go back to $1. +Whenever there’s a price discrepancy between USD and UST, Terra relies on this genius arbitrage incentives to bring price back to $1. +
+But why can’t the burn-and-mint mechanism save the day? Let’s go back to what happened. + + +The crash started it off with UST losing its dollar peg repeatedly. +This causes investors, and whales in specific, losing their confidence in this algorithmic stablecoins. +The peak of uncertainty was on the weekend of 7th and 8th of May. +During two days, a massive amount of UST were withdrawn from Anchor protocol. +On Friday, 6th of May, there was still around 14 billion of UST locked in Anchor protocol as deposits. +On Monday, this figure was down to 10.8 billion. This means that around 3.2 billion of UST were taken out over the weekend. +Inevitably, this put a massive selling pressure on UST and lead to UST further losing its peg. + + +As UST peg is too far away from 1 dollar, a massive amount of LUNA needs to minted in order to push the price back. +With such a large amount of LUNA dumped in the market, the circulating supply shot up and caused luna price to fall. +Let’s keep in mind that this happened during a market crash, and hence the selling pressure has doubled up. +
+This is clearly reflected in the LUNA’s circulating supply. +In just few days, number of Luna went to the moon, from less than 400 millions token to over 6 trillions. + + +Eventually, with the enormous selling pressure, Luna price has fallen below $1 mark, even lower than UST’s supposed value. +This continues until Luna’s market cap became smaller than UST’s. +With this, the peg stablization mechanism can no longer work, ended the hope of many investors that price can still go back up. +
+As a revival plan, Do Kwon proposed to hard-fork Luna to a completely new chain, with a snapshot before the attack. + + +This new chain would have maximum supply of 1 billion coins. Out of these: + * 400M would be given to Luna holders before the depeg happened + * 400M to UST holders at the time of the upgrade + * 100M to Luna holders when the blockchain stops functioning + * 100M for community pool + + +He also mentioned to change the mint-and-burnt mechanism to a collateralized version, similar to what MakerDAO does with their DAI stablecoin. + + +The biggest question is: do investors have the courage to give Do Kwon and Terra’s team their trust one more time? +This bank run has put an end to a once $40 billion cryptocurrency and once the top 3 biggest stablecoins by market caps, wiping out fortunes of investors and validators. +
{text}
" + return f'{text}
' def row(elements: List) -> str: @@ -163,7 +166,7 @@ def kpi(thresholds: List[float], sentences: List[str], value: float) -> str: return "" -def add_tab(title: str, htmlcode: str) -> str: +def add_tab(title: str, htmlcode: str, comment_cell: bool = True) -> str: """Add new tab section for the report. By default adds an opinion editable box at the start. Parameters @@ -172,18 +175,22 @@ def add_tab(title: str, htmlcode: str) -> str: Title associated with this tab / section htmlcode : str All HTML code contain within this section + comment_cell : bool + Comment cell Returns ------- str HTML code as string """ - return f"""' + if comment_cell: + html_text += """
No comment. -
{htmlcode} -{title}
""" + + +def add_external_fig(figloc: str, style: str = "") -> str: + """Add external figure to HTML + + Parameters + ---------- + figloc : str + Relative figure location + style: str + Div style + + Returns + ------- + str + HTML code for figure + """ + try: + with open(figloc, "rb") as image_file: + img = base64.b64encode(image_file.read()).decode() + return f'