Algorithmic Stablecoins_ What they are and how they can go horribly wrong

Algorithmic Stablecoins_ What they are and how they can go horribly wrong

The stunning crash of the UST stablecoin and its sister token LUNA has many questioning whether an algorithmic stablecoin can be trusted.

Cryptocurrencies are known for their volatility; they can rise and fall in the double digits. However, one form of cryptocurrencies, called stablecoins, aims to provide a refuge for those who want to get out of the constant volatility and still stay in the crypto market.

Stablecoins are cryptocurrencies that are meant to be pegged to fiat currencies like the US dollar. Stablecoins that are pegged to the US dollar are said to always have a price of $1.

Individual stablecoin projects differ in how they maintain the peg. The two largest, Tether (USDT) and Circle's usd coin (USDC), are "overcollateralized" by fiat reserves, meaning they have cash or cash-like assets in their reserves. So any UST or USDC traded in the crypto market is backed by what is actually owned by the stablecoin issuers. Similarly, MakerDAO's stablecoin DAI is decentralized, but also over-collateralized - backed by Ether (ETH) deposited into the smart contracts.

In the past year, however, a new form of stablecoin has emerged that differs in its collateralization: algorithmic stablecoins, such as terraUSD (UST), magic internet money (MIM), frax (FRAX), and neutrino usd (USDN).

They are called algorithmic because there is an on-chain algorithm behind them that allows supply and demand to change between them (the stablecoin) and another cryptocurrency that backs them.

In the case of the Terra blockchain, which runs the largest algorithmic stablecoin platform, the algorithmic tango is performed by UST, a stablecoin, and Terra (LUNA), the Terra-owned cryptocurrency that backs the stablecoin. For the rest of this article, we will use "LUNA" to refer to terra (LUNA) to avoid any confusion.

Algorithmic stablecoins are typically undercollateralized - they do not have independent assets in reserve to back the value of their stablecoins. In fact, the terms "under-collateralized stablecoins" and "algorithmic stablecoins" are often used interchangeably.

What are algorithmic stablecoins?

Algorithmic can be a confusing word. But it simply means a set of codes that instruct a process. For example, what you see on your Facebook timeline is determined by Facebook's timeline algorithms, which take into account, among other things, how relevant the post is to you based on your past online behavior. In the crypto economy, an algorithm refers to pieces of code on the blockchain that are encoded in a series of smart contracts.

Algorithmic stablecoins are typically based on two tokens - a stablecoin and another cryptocurrency backing the stablecoins - and the algorithm (or smart contract) governs the relationship between the two.

Cryptocurrencies - much like any asset on the market, such as houses or stocks - move up and down in price depending on market demand and supply of the asset. This is also true for stablecoins, as they are essentially cryptocurrencies that are freely traded on the market.

To prevent the price of a stablecoin from moving away from $1 while subject to market conditions, algorithms regulate supply and demand. If there is too much demand for an asset but little supply, the price of that asset will rise - and vice versa.

The promise of the algorithm is to keep this in check, as we explore in the next section in the context of UST, before looking more closely at how it can go wrong.

How is UST supposed to maintain its binding?

TerraUSD (UST) maintains - or is supposed to maintain - its 1:1 parity with the U.S. dollar via an algorithmic relationship with Terra's own cryptocurrency, LUNA. Behind this relationship is an arbitrage opportunity that presents itself every time UST loses its peg in either direction.

When UST supply is too low and UST demand is too high, the UST price rises above $1. To tie UST back to its peg, the Terra protocol allows users to trade 1 USD of LUNA for 1 UST on the Terra station portal. This trade burns 1 USD of LUNA and mints 1 UST, which users can sell for 1.01 USD and pocket a profit of 1 cent. This doesn't sound like much, but these profits add up when made in large quantities.

Users can mint as many USTs from burned LUNA until the UST drops back to 1 USD. When supply increases, the price eventually decreases - at least that's the logic behind it.

When supply is too great and demand is too low, the opposite occurs: The UST price drops below $1. So the protocol allows users to do the opposite of what was described above: Users can buy 1 UST for $0.99 and then trade 1 UST for $1 of LUNA. The trade burns 1 UST and converts 1 USD into LUNA, giving the arbitrageur a profit of 0.01 UST.

Again, the Terra protocol allows users to continuously burn UST and receive LUNA until UST reaches 1 USD.

The second scenario - a value falling below the peg - is a more common problem for algorithmic stablecoins, as market anxiety around them is greater than market euphoria, leading to more instances of lower demand and higher supply.

The algorithmic relationship of UST to LUNA means that the latter must absorb the volatility of the former. Since new LUNA can be minted whenever UST is below $1, the price of LUNA can go into freefall in the face of rising token supply.

In response to mounting criticism that UST is in a vulnerable state due to the lack of an external safeguard mechanism - independent collateral - Do Kwon, the CEO of Terra creator Terraform Labs and the primary UST creator, established the Luna Foundation Guard, an entity responsible for maintaining the stablecoin's bond, in February 2022. It has - or had - a goal of buying up to $10 billion worth of Bitcoin (BTC) to support the peg.

How did UST unravel in May 2022?

Slowly at first, then suddenly.

UST began depegging on May 7, when large-volume withdrawals from Terra's largest decentralized financial protocol anchor (DeFi) began in earnest. This had a domino effect on the UST pool on Ethereum's Curve protocol, the main hub for stablecoin liquidity across DeFi, where large volumes of withdrawals also occurred.

Some blame a coordinated attack for the events that led to UST's exit. Others believe it was a series of spontaneous, panicked withdrawals due to deteriorating market conditions, particularly the price of bitcoin that LFG added to its reserve to support UST. In any case, the stablecoin did not withstand enough pressure to maintain its peg, eventually falling as low as $0.29 on May 11.

Since LFG, the company defending UST's peg, has so many bitcoin reserves, some analysts believe it may have also contributed to the bitcoin price crash, as many feared the organization would dump billions of bitcoin. But it's a double whammy: the falling bitcoin price also means the LFG has less ammunition in its arsenal.

But isn't that where the algorithm should work its magic?

The algorithm to burn UST and mint LUNA when UST is below $1 didn't work so well; it couldn't keep up with the extreme conditions. According to a proposal Kwon submitted on May 11, the algorithm could not mint new LUNAs at the rate needed to recouple UST (it had to outpace the market rate, and it could not). If the proposal were adopted, more LUNA would be minted in less time.

Defending UST means sacrificing the price of LUNA, as it increases the supply of LUNA, and more supply means selling pressure on the price of a token. As a result, LUNA crashed violently on the night of May 11, falling more than 97% to as low as $0.88.

A detailed statement of the May 11 proposal said, "In extreme situations like this, Terra cannot save the UST pen and the LUNA price at the same time."