Terra Crash Overview

Mat__A
Coinmonks
11 min readMay 19, 2022

--

How did the LUNA crash happen? What were the lessons learned? What’s next for Terra?

What is Terra?

Terra protocol is an open source public blockchain known for its native staking token LUNA. Up until recently, Terra was home to an array of algorithmic stablecoins. The most widely recognized of these stablecoins was UST, a digital asset designed to track the price of the U.S dollar.

At its peak, UST attained a market cap of $18.7B. Unfortunately, the success of UST was relatively short lived, when supposedly a mysterious player with very deep pockets set forth a chain of events that triggered UST to swing below its $1 peg, eventually leading to a catastrophic market crash that saw UST drop to below $0.1, resulting in many people losing devastating sums of money.

So how did this happen? To get a better understanding of how this chain of events unfolded, let’s start by briefly discussing Terra’s algorithmic stablecoin design.

Source: https://twitter.com/stablekwon/header_photo

Algorithmic stablecoins

By tracking the price of fiat currencies, digital stablecoins are intended to provide a store of value that is resistant to typical crypto market volatility.

To maintain a stable price, algorithmic stablecoins typically rely on two tokens — one being the stablecoin, and another token who’s value controls the issuance of new stablecoins, which is regulated via an algorithm.

In contrast, custodial stablecoins such as Tether (USDT) and Circle (USDC) are instead backed 1:1 by fiat currency, which ultimately makes them more vulnerable to regulatory pressures.

Terra is a Proof-of-Stake (PoS) blockchain with the native token, LUNA. The LUNA token had two purposes:

  1. Providing staking incentives for validators, who are responsible for securing the network and adding new blocks to the chain.
  2. Acting as a collateral token that adsorbs price volatility for the UST stablecoin.

Algorithmically adsorbing price volatility for the UST stablecoin involved two mechanisms:

  • Seigniorage — Minting 1 UST requires burning $1 worth of LUNA, contracting the LUNA supply and inflating the UST supply.
  • Contraction — Redeeming $1 worth of LUNA requires burning 1 UST, contracting the UST supply and inflating the LUNA supply.

The redemption of tokens following these mechanisms was conducted via the Market Module, which was a virtual liquidity pool natively integrated into the terra station wallet.

UST algorithmic stablecoin design explained by Danku_R.

Maintaining the peg by arbitrage

On top of these algorithmic mechanisms, users were incentivized to maintain the UST dollar peg through arbitrage opportunities.

Through the algorithmic mechanism, an opportunity for arbitrage is created when the price of UST drops below $1. In the instance that the price of UST is $0.98, an investor would be able to swap the $0.98 of UST in the Market Module for $1 worth of Luna. To complete the arbitrage, the investor would then sell their Luna for UST at 1:1 on the open market for $0.02 profit.

Maintaining the UST peg via arbitrage. Source: https://chaindebrief.com/what-happened-to-terra-luna-crash-ust/

This has two positive effects on UST price. First, swapping UST to LUNA in the market module reduces the available supply of UST. Second, selling LUNA for UST on the open market increases demand for UST. Together, the reduction in supply, along with the increased demand for UST help to raise its price up to $1.

But when these tokens are simply being interchanged between one another, how come UST remained stable while LUNA fluctuated in value?

LUNA token value

Terra’s growth and the value of the LUNA token were both strongly tied to demand for UST. For UST to enter circulation, LUNA needed to be burnt.

Therefore, as more people sought to use UST for everyday purchases and within DeFi, the supply of LUNA would become programmatically scarcer, which had many speculating that this would drive up the price of LUNA.

Demand for the UST stablecoin was driven by two main sources:

  • CHAI, an e-wallet for fast and cheap payments using the Terra Blockchain in South Korea with $1.2 billion in payments per year.
  • DeFi — investors using UST for trading, borrowing, buying NFTs and liquidity farming on popular Terra Dapps such as Anchor, Mirror, Astroport, Prism Protocol, OnePlanet and so on.

Considering that UST reached a market cap of 18 billion, the 1.2 billion used for real world payments only made up a small portion of this demand, while the majority of the so called “utility” for UST was primarily driven by speculation.

How did Terra become so successful?

So called “battle-tested” stablecoin peg

In May 2021, most cryptocurrency prices plunged by 30% or more. During this crash, the price of UST also dropped to $0.92, but quickly regained its $1 peg. By being able to withstand the major market volatility during this period, the algorithmic mechanism of the UST stablecoin had managed to prove itself in the eyes of many investors.

UST was stable — until it wasn’t. Source: https://www.coingecko.com/en/coins/terra-usd

Low transaction fees

Also, low transaction fees offered on the Terra blockchain was very attractive for many users who had been suffering from high gas fees on Ethereum, which sometimes crept upwards of $200-$400 per transaction. In contrast, tax fees on Terra ranged from 0.1% — 1% per transaction.

Attractive yield opportunities

Another key part of Terra’s rapid growth strategy was the deployment of Anchor Protocol, which acted as a decentralized bank that promised users up to 20% annual percentage yield (APY) for depositing their UST.

Immediately, this sounds too good to be true — and eventually turned out to be. While the 20% yield was unsustainable, the mechanism for deriving this yield from over-collateralized loans, staking rewards and liquidations is worth reading into. To learn more about how Anchor Protocol’s former 20% APY, check out this article.

Flourishing ecosystem of Dapps

As the quote goes, “Build it and they will come”. This was definitely the case for Terra. Upon recognizing the opportunities to innovate and experiment with their technology, a strong community of highly skilled developers flocked to the Terra blockchain.

Terra Dapp Ecosystem. Source: https://terra.smartstake.io/eco

Where did it all go wrong for Terra?

To sum things up at a high level, Terra’s collapse stemmed from a large-scale depeg of the UST stablecoin, where the price of UST dropped below $1 and could not recover.

At the same time, the price of Luna also imploded. This was partly attributed to the algorithmic model responsible for maintaining the UST peg. As described earlier, during periods of contraction, increasing the price of UST back to $1 requires a reduction in the circulating supply of UST, which can be achieved by burning UST and minting more LUNA — but this comes at a major cost for LUNA holders, because attempting to recover the UST peg involved inflating the supply of Luna by massive proportions, severely diluting the price of Luna.

What triggered the UST depeg?

Rather than retelling the story, I will refer you to an incredibly well written twitter thread by Onchain Wizard summarizing the chain of events that led to UST dropping below its $1 peg.

Summary of events leading to UST depeg by Onchain Wizard.

But now you may be wondering — the UST peg has been restored during market crashes in the past. So, what was different this time?

Expensive arbitrage due to high slippage

The primary reason that arbitrage could not save the peg was because swapping from UST to LUNA encountered high slippage costs during the crash. Essentially, this made arbitrage cost ineffective.

But first, what is slippage?

To facilitate swaps between Luna and UST using the algorithmic mechanism, both assets needed to exist in virtual liquidity pools. The swap price for redeeming UST or LUNA through the Market Module is based on the X*Y=K constant product formula, which is a model used by other popular automated market makers (AMMs) such as Uniswap. The graph for this X*Y=K model is displayed below.

Constant Product Formula (X*Y=K) used by many Automated Market Maker (AMM). Source: https://ethresear.ch/t/improving-front-running-resistance-of-x-y-k-market-makers/1281

Basically, price slippage occurs if a change in demand for one token impacts the balance of tokens available in the pool.

As demand increases for a token, the number of those tokens available in the pool is reduced and the price paid per token increases. Therefore, the overall swap price may end up being a lot higher as more tokens are traded — this change in swap price is referred to as slippage.

For many trades in large liquidity pools, this effect is relatively minimal because the tokens being swapped are just a drop in the ocean in proportion to the size of the pool. However, when there are large trades, large volumes of trades for a single token, or large amounts of tokens being removed from the pool, the effect of slippage may become more pronounced.

Not quite the same form of “slippage”… Source: https://media.giphy.com/media/3oxRmGNqKwCzJ0AwPC/giphy.gif

After UST lost its peg, many investors likely would have moved to protect profits by swapping LUNA back to UST. At the same time, many others were likely moving their UST from liquidity pools to centralized exchanges, where they could trade the UST for blue chip cryptocurrencies like Bitcoin or Ethereum, or custodial stablecoins like Tether (USDT).

Additionally, since the UST peg had slipped by such a large extent, the only way to recover the peg involved swapping very large amounts of UST to LUNA via the market module, which was needed to contract the UST supply and raise its price back to $1.

With many of these factors acting in concert, the price of slippage for trading UST to Luna increased. This was clearly seen during the Terra crash, in which there was a massive spike in average spread/slippage for swapping UST to Luna on May 11, which increased from 0.5% to nearly 45%, as seen below.

Max and Average slippage/spread for swapping UST to LUNA via the Market Module. Source: https://app.flipsidecrypto.com/dashboard/terra-market-module-stats-c5WXml

Above a certain point, the cost of swapping “cheap” UST (i.e. below peg) for $1 worth of Luna exceeded the profit that could be made when arbitraging the trade, as reported by White Whale in the post below:

Finally, as the price of UST strayed further from the peg, the more expensive and unlikely it became that the peg would ever be recovered.

Reflections on the Terra crash

The devastating effects of the Terra crash were felt far and wide.

Many investors lost large sums of money within minutes. Projects building on Terra had their financial runways reduced from months to days. Some projects simply had no choice but to discontinue building and abandon all their hard work. Most tragic of all was hearing of those who felt they had lost too much to bear and ended up taking their own lives. For anyone reading this who feels trapped with nowhere to go — please reach out for help. Don’t make a decision that you can’t undo.

There are many important lessons to be leant from the Terra crash. For the many of us that sunk hours into building and lost large amounts of money, we need to accept that what’s done is done — there’s nothing that can be done to change the outcome of the situation. What’s important is how we use this experience to grow and build back stronger than before.

Like many others, I became blinded by the ethos of decentralized money and entrusted too much faith in the UST stablecoin, resulting in my portfolio becoming severely undiversified. Additionally, I’d become so focused on learning about all the innovative projects building on the Terra blockchain that I neglected the one core risk that would tear the entire ecosystem to the ground; the risk of UST depegging. A tough pill to swallow, but also a very valuable learning experience.

For a list of highly valuable lessons from the Terra crash, I highly recommend saving the following thread by The Defi Edge.

Wider implications

When Terra crashed, a tidal wave effect was felt throughout the entire crypto market. Within a matter of days, over $400 billion in value was shaved off the overall crypto market capitalization.

While this crash is unlikely to threaten the stability of the global financial system on its own, it is definitely enough to capture the attention of regulators and decision makers.

Possible looming regulations for stablecoins?

With stablecoins continue to grow at a rapid pace, concerns around their impacts on the economy are beginning to surface. Following the recent crash, Treasury Secretary Janet Yellen called for “comprehensive” regulation of stablecoins. Additionally, the EU will soon roll out a specific regulatory framework for cryptocurrencies and markets, which has already stirred some controversy.

What’s next for the Terra blockchain?

On May 17th, Do Kwon, the founder of Terra presented a plan to revive the fallen ecosystem. Details of this proposal were shared on the Terra Agora platform, but can also be found in the Twitter thread below.

To provide a high level overview, the proposal would result in forking the blockchain in two, the old one being Terra Classic, and the new chain to be called Terra. Importantly, the new chain will be developed without an algorithmic stablecoin.

Focus on retaining talent

Given the strength of the builders and developers within the Terra community, a core focus of the proposal is retaining this talent. Many of the Dapps on Terra offered innovative DeFi opportunities, tools, features, and fantastic UIs, that are yet to be seen on other blockchains, such as the ability to refract assets into principle and yield bearing tokens with Prism Protocol, or to assemble/disassemble NFTs on OnePlanet. By drawing upon these protocols alone, there is hope for Terra, should the builders choose to stay.

Token distribution concerns

This being said, the proposal to distribute a total of 30% of new LUNA tokens to those who hold UST and Luna on the 27th of June 2022 raises a few eyebrows. On one hand, the proposal to distribute LUNA to post-attack holders may increase the distribution of new Luna tokens across more unique holders, but on the other hand, it feels like a bit of a last ditch attempt at artificially creating demand for the original tokens.

Additionally, trust and confidence in the Terra blockchain has been dealt a major blow, so it could end up being a long road ahead before Terra even slightly resembles it’s former glory.

Closing remarks

Personally, I will continue to support Terra, whether it be through publishing articles on latest developments or investing in innovative projects. At the same time, I’ll be spending more time learning about other blockchains and Web3 projects, which I will be sure to look at through a fresh set of eyes, based on the lessons learnt from the Terra crash.

--

--

Mat__A
Coinmonks

E-Learning Specialist. Crypto, craft beer and motorcycle enthusiast. Focused on researching, making mistakes and sharing the learnings so you don’t have to.