Division by zero
Terra offers some simple crypto lessons
Last week was a rough one for crypto. The troubles of two stablecoins were in the spotlight: reserve stablecoin Tether struggled to hold its peg to the dollar; algorithmic stablecoin TerraUSD collapsed entirely.
In this post: the mechanics of the TerraUSD meltdown, and three simple lessons to draw from the whole affair.
Best laid plans
TerraUSD was a stablecoin, a crypto asset meant to trade at par, a fixed price of one. TerraUSD was in fact an algorithmic stablecoin, which means that it used an automatic market-making mechanism to try to keep its dollar price at one, rather than a discretionary mechanism like that of Tether. On May 9, TerraUSD started trading below par, a problem that the algorithm was supposed to solve.
TerraUSD was meant to work by creating an arbitrage opportunity. Miners, participants in Terra’s distributed computation mechanism, hold TerraUSD tokens. In the T accounts below, I show these as a liability to the Terra protocol, because that is how they function in this system. Whether those claims would hold up in a legal system is doubtful, but they are liabilities all the same.
Suppose that these TerraUSD tokens are trading at 90 cents on the dollar, as they were in the afternoon of May 9 (see graph below). In the TerraUSD system, miners can redeem (“burn”) TerraUSD tokens in exchange for a different token, Luna. Luna tokens entitle their owner to a share of the proceeds of mining. This is not unlike a bondholder’s receiving interest, or a shareholder’s receiving dividends, so I show them as another liability to the Terra protocol. Redemption of TerraUSD tokens for Luna tokens is handled by unattended programmable contracts, with no discretionary human intervention.
If a miner redeems TerraUSD, trading at 90 cents but with a face value of one dollar, the algorithm gives them one dollar’s worth of Luna, measured at Luna’s current market price. If the market price of Luna is p, that is, the miner receives 1/p tokens. So when Luna tokens were trading at around $50, one token of TerraUSD could be redeemed for 0.02 Luna tokens. 0.02 tokens at $50 has a market value of one dollar. This means that the miner has turned a TerraUSD token with a market price of 90 cents into Luna tokens with a market price of one dollar, an arbitrage profit of ten cents.
All this is to make it so that when TerraUSD tokens are below par, people want to buy them up, bringing their price back to par. To do this, the algorithm gives out free money in the form of Luna tokens, and all you have to do is find someone who will exchange those Luna tokens for dollars at that price.
A unique kind of death spiral
So what happened last week? The dollar price of TerraUSD is shown in the top panel of this graph. Until May 9, things were going pretty well. The price occasionally moved away from one, for example on May 7, but was quickly brought back into line:
On May 9, TerraUSD fell significantly below par. The Terra algorithm began issuing new Luna tokens. But the reason to hold Luna tokens is that they entitle the holder to the proceeds of mining TerraUSD. That value proposition was becoming increasingly unconvincing, and so there were not many buyers for Luna tokens.
Remember that the Terra algorithm issued 1/p Luna tokens for each burned TerraUSD token. As the price of Luna tokens fell to zero over the next three days, the number of Luna tokens outstanding exploded, going from numbering in the hundreds of thousands to numbering in the trillions over a few days. Trading was suspended and both tokens are now agreed to be worthless.
Three lessons, for those who wish to learn them
The TerraUSD algorithm implicitly assumed that there would be buyers for Luna tokens. When the protocol’s existence was at stake, there were no buyers, no matter how low the price.
In other words, TerraUSD implicitly assumed that market liquidity would be freely available. In fact, it became impossible to sell—the market became illiquid.
The algorithm had the price of Luna tokens in the denominator of a fraction. The price went to zero, and the fraction went to infinity. And not in a good way.
Terra shares these structural features with other automated market-makers, but they are never mentioned in crypto white papers. You may want to prepare by seeking out more skeptical perspectives.