Algorithmic Stablecoins: What They Are and How They Can Go Terribly Wrong

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

AccessTimeIconMay 12, 2022 at 1:58 p.m. UTC
Updated May 11, 2023 at 4:47 p.m. UTC

Cryptocurrencies are known for volatility; they can go up and down in double digits. But one form of cryptocurrency, called stablecoins, aims to provide refuge to those who want to exit constant volatility while still staying in the crypto market.

Stablecoins are cryptocurrencies that are supposed to be pegged to fiat currencies like the US dollar. In the cases of USD-pegged stablecoins, their prices are supposed to be $1 at all times.

Each stablecoin project differs in ways they maintain the peg. The two biggest ones, tether (USDT) and Circle's usd coin (USDC), are “over-collateralized” by fiat reserves, meaning they have cash or cash-equivalent assets in their reserves. So each USDT or USDC traded in the crypto market is backed by what’s actually in the possession of the stablecoin issuers. Similarly, MakerDAO’s stablecoin DAI is decentralized but also overcollateralized – backed by ether (ETH) deposited into its smart contracts.

Over 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’re called algorithmic because what backs them is an on-chain algorithm that facilitates a change in supply and demand between them (the stablecoin) and another cryptocurrency that props them up.

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), Terra’s native cryptocurrency that backs the stablecoin. For the remainder of this article, we will use “LUNA” to refer to terra (LUNA) to avoid any confusion.

Algorithmic stablecoins are typically undercollateralized – they don’t have independent assets in reserves to back the value of their stablecoins. In fact, “undercollateralized stablecoins” and “algorithmic stablecoins” are often used interchangeably.

What are algorithmic stablecoins?

Algorithm can be an obfuscating word. But it simply means a set of code that instructs a process. So, for example, what you get to see on your Facebook timeline is determined by Facebook’s timeline algorithms, which include things like how relevant the post is to you based on your past online behavior. In crypto, an algorithm refers to pieces of code on the blockchain, as encoded in a set of smart contracts.

Algorithmic stablecoins typically rely on two tokens – one stablecoin and another cryptocurrency that backs the stablecoins – and so the algorithm (or the smart contact) regulates the relationship between the two.

Cryptocurrencies – similar to all assets in the market, such as houses or stocks – move up and down in price depending on the market demand and the supply of the asset. This also includes stablecoins because they’re essentially cryptocurrencies freely traded on the market.

To prevent the price of a stablecoin depegging – moving away from $1 – while subject to market conditions, algorithms regulate supply and demand. When there’s too much demand for an asset but little supply of it, the price of that asset goes up – and vice versa.

The algorithm’s promise is to keep this in check, as we explore in the context of UST in the next section, before delving deeper into how that can go terribly wrong.

How is UST designed to maintain its peg?

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

When the UST supply is too small and demand for it is too high, the price of UST goes above $1. To bring UST back to its peg, the Terra protocol lets users trade 1 USD of LUNA for 1 UST at 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. It doesn’t sound like a lot, but these profits add up when done in large quantities.

Users can mint as much UST as needed from burned LUNA until UST goes back down to $1. As the supply increases, the price eventually comes down – or that’s at least the logic behind it.

When the supply is too large and demand is too low, the opposite happens: The price of UST goes below $1. So the protocol lets users do the opposite as above: Users can buy 1 UST for 0.99 USD, then trade 1 UST for 1 USD of LUNA. The trade burns 1 UST and mints 1 USD of LUNA, netting the arbitrage trader a profit of .01 UST.

Again, the Terra protocol lets users continuously burn UST and receive LUNA until UST reaches $1.

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

UST’s algorithmic relationship with LUNA means that the latter has to absorb the volatility of the former. Since new LUNA can be continuously minted any time UST is below $1, the price of LUNA can free-fall in the face of increasing token supply.

In response to mounting criticism that UST is in a vulnerable state with no external backing mechanism – independent collateral assets – Do Kwon, the CEO of Terra creator Terraform Labs and the main man behind UST, set up Luna Foundation Guard in February 2022, an entity in charge of maintaining the stablecoin’s peg. It has – or had – a goal of buying as much as $10 billion in bitcoin (BTC) to support the peg.

How did UST depeg in May 2022?

First slowly, then suddenly.

UST began depegging on May 7, as large-volume withdrawals from Terra’s largest decentralized finance (DeFi) protocol Anchor began in earnest. These had a domino effect on the UST pool on Ethereum’s Curve Protocol, the main hub for stablecoin liquidity in all of DeFi, which also saw high-volume withdrawals.

Terra’s DeFi protocol Anchor, which saw its TVL shred $11 billion as of 11 May. (DeFi Llama)
Terra’s DeFi protocol Anchor, which saw its TVL shred $11 billion as of 11 May. (DeFi Llama)

Some blame the events that led to UST’s depegging on a coordinated attack. Others think it was a series of spontaneous panic-ridden withdrawals due to the souring wider market conditions, especially in the price of bitcoin that LFG has added to its reserve to back UST. In either case, the stablecoin hasn’t withstood the pressure enough to maintain its peg, eventually falling as low as $0.29 on May 11.

Since LFG, the entity that defends UST’s peg, has so much bitcoin in reserve, some analysts think it may have also fueled bitcoin’s price crash, as many feared the organization could dump billions of bitcoin. But it’s a double whammy: Falling bitcoin price also meant the LFG has less ammunition in its arsenal.

But isn’t this where the algorithm should work its magic?

The algorithm, which is supposed to burn UST and mint LUNA when UST is below $1, hasn’t worked as well; it’s failed to keep up with the extreme conditions. According to a proposal submitted by Kwon on May 11, the algorithm couldn’t facilitate the minting of new LUNAs at a speed needed to re-peg UST (it had to outrun the market speed, and it couldn’t), and so a proposed change in code would alter the mint cap and speed up the algorithmic process. The proposal, if passed, would see more LUNA minted in a shorter span of time.

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

An elaborate explanation of the May 11 proposal states, “In extreme situations like this, Terra cannot save both UST peg, and save LUNA price at the same time.”

This article was originally published on May 12, 2022 at 1:58 p.m. UTC


Please note that our privacy policy, terms of use, cookies, and do not sell my personal information has been updated.

CoinDesk is an award-winning media outlet that covers the cryptocurrency industry. Its journalists abide by a strict set of editorial policies. In November 2023, CoinDesk was acquired by the Bullish group, owner of Bullish, a regulated, digital assets exchange. The Bullish group is majority-owned by; both companies have interests in a variety of blockchain and digital asset businesses and significant holdings of digital assets, including bitcoin. CoinDesk operates as an independent subsidiary with an editorial committee to protect journalistic independence. CoinDesk employees, including journalists, may receive options in the Bullish group as part of their compensation.

Ekin Genç

Ekin Genç has written for Bloomberg Businessweek, EUobserver, Motherboard, and Decrypt.

Learn more about Consensus 2024, CoinDesk's longest-running and most influential event that brings together all sides of crypto, blockchain and Web3. Head to to register and buy your pass now.