Stablecoins — Defining the Terra Algorithmic Design

The Intern
Terra
Published in
27 min readJun 9, 2021

In light of the recent volatility, there have been numerous questions about the granular mechanics of the Terra protocol — specifically how it applies to the mint/burn mechanism, the role of LUNA in absorbing volatility, the UST peg’s maintenance, and how Terra compares to other stablecoins.

We’ve decided to release a detailed, comprehensive overview of the Terra protocol’s mechanics from both a macro and micro perspective. Clarity is critical for the community and prospective investors, so we want to ossify the protocol’s mechanism design as a reference source for future inquiries.

Previously, we’ve covered the Terra protocol’s mechanics at both a high level and more technical level via core researcher Nick Platias’ “Introducing the New Terra Protocol” piece, and of course, the Terra Whitepaper — both of which have become slightly outdated.

In this piece, we will synergize the efforts of previous essays defining the Terra protocol while also allaying misconceptions and providing context on recent developments and how they impact the protocol’s evolution.

Narratives are the thread that binds communities. So without further ado, we’re pleased to present the Terra protocol in a new light — a special edition for our amazing LUNAtic community.

Stablecoin Overview

Stablecoins are a powerful innovation. They fulfill the “currency” mandate of cryptocurrencies by eschewing price volatility in favor of mechanisms that maintain a peg to fiat currencies through various designs.

Stablecoin adoption is exploding, as clearly displayed in their meteoric overall market cap growth from roughly $6 billion at the beginning of 2020 to the current mark of over $100 billion.

Source — https://www.theblockcrypto.com/data/decentralized-finance/stablecoins/total-stablecoin-supply-daily

As DeFi has blossomed, stablecoin usage has amplified in lock-step.

There’s no single reason for the growth, but rather a multitude of compelling advantages that stablecoins operating on permissionless blockchains afford users. These advantages are derived from numerous contexts, including expanding access to USD-denominated liquidity for a global user set to offering stable stores of value during periods of excessive market volatility.

More succinctly, Castle Island Ventures describes stablecoins in their lucid report, “Cryptodollars: The Story so Far” as:

“Cryptodollars exist to merge the low volatility characteristics of sovereign currencies like the dollar with the settlement assurances of public blockchains. In short, they allow you to move and settle arbitrary amounts of fiat currency anywhere over the internet with strong finality and few of the encumbrances of the traditional banking system.”

Dubbed the “Holy Grail of Cryptocurrencies,” stablecoins offer a global user set an intuitive way to understand the benefits of price-stable cryptographic tokens — something at Terra we believe can function as a gateway to the mass adoption of DeFi applications.

At a cursory glance, it may seem like price-stable cryptocurrencies are simply fiat currencies on blockchains, tilting at a use case under the looming shadow of central banks and political leverage. But when you dive into the prospects, innovation, and diverse characteristics of stablecoins, their value proposition begins to crystallize.

Mapping Out Stablecoins — Determinism for the Win

Compared to legacy financial infrastructure, where currencies operate on fragmented systems enveloped in diverse regulatory frameworks, ideologies, and policies, stablecoins operate on a shared infrastructure — blockchains.

This affords stablecoins unique qualities that cannot be matched by existing financial tooling. Blockchains serve as an open, permissionless foundation from which DeFi can build an entirely new financial stack — one that is magnitudes more powerful. Stablecoins have subsequently morphed into a lynchpin of DeFi’s financial stack, with various designs competing to emerge from the crucible of the Internet-native currency wars.

The long-term goal of stablecoins is for them to acquire the properties of the blockchains underscoring them. Namely, censorship-resistance, while designing peg mechanisms that can withstand extreme volatility at a low cost.

The latter point is essential. A stablecoin peg design infused with robust defenses against volatility at a minimal cost can adequately scale to the levels necessary for a price-stablecoin cryptocurrency to garner mass adoption in the hostile environment of the Internet. As a result, stablecoins that are censorship-resistant and can scale to mass adoption need to be:

  • Decentralized
  • Maintain Robust Peg Assurances Amid Volatility
  • Low-cost of Issuance

Stablecoins were originally conceived through a centralized lens, where an issuer (e.g., Tether) circulates cryptographic tokens backed 1:1 by fiat reserves in their custody — effectively issuing tokenized IOUs on a specific blockchain.

However, rapid growth and capital inflows into crypto markets have stoked a gradual exploration of stablecoins further down the decentralized spectrum.

In particular, we can classify stablecoins into 2 buckets:

  1. Custodial Stablecoins
  2. Non-Custodial Stablecoins

All stablecoins designs follow a reasonably simplistic model at a high level, — maintaining parity between assets and outstanding liabilities (e.g., the circulating stablecoins). However, they differ primarily in their management of the balance sheet. The mint/redemption mechanism often serves as the locus of the overall mechanism design, from which open market incentives are derived.

Whether the mint/redemption mechanism is programmatic (algorithmic), operated by siloed, over-collateralized debt positions (crypto-collateralized), or administered by a third-party exogenous to the blockchain (custodial), stablecoins make candid trade-offs in varying degrees to achieve price-stability — the first and primary goal of any stablecoin worth its chops.

Custodial Stablecoins

Represented by the industry’s stablecoin leaders, fiat-collateralized stablecoins are the most intuitive to understand and currently dominate the overall stablecoin market cap. In such a model, an issuer maintains a reserve backing the outstanding liabilities (circulating supply) of stablecoins on a 1:1 basis either directly or with a third-party custodian — such as a bank.

For example, Circle’s USDC deploys what are essentially tokenized IOUs (e.g., USDC) onto the respective blockchain ledger (e.g., Ethereum), balancing the supply and demand of circulating USDC to maintain the peg via its redemption mechanism. Peg parity is extremely robust since the redemption mechanism allows any user to “mint” USDC in exchange for depositing the analogous fiat currency (USD) with the issuer — Circle — on a 1:1 basis. Users that want to “redeem/burn” USDC can go to Circle to swap an arbitrary amount of USDC for USD 1:1 or vice versa.

NoteUSDC can ALWAYS be exchanged with USD at the issuer window 1:1.

The above mechanism induces a distinct incentive to maintain the peg. Since prospective arbitrage traders can always mint/redeem USDC at Circle 1:1, they can take advantage of price dislocations in the peg on the open market.

For example, if USDC is trading at $1.02 on Binance, Alice can swap $100 of fiat USD for 100 USDC at Circle, transfer to Binance, and sell the 100 USDC for $102, pocketing a profit of $2 excluding trading fees and other transaction costs. With high liquidity across multiple exchanges and fiat on-off ramps, Alice’s actions are replicated by other market participants (including whales), applying downward pressure on USDC’s peg. Minor peg dislocations in a given epoch are remedied, with peg deviations usually ephemeral and exploited by bots and professional traders.

Arbitrage players can also alleviate peg dislocations on price disparities of USDC across markets, further fortifying the peg’s hold. For example, buying USDC at a discount on Binance and selling it at a premium on Curve.

In the case of Circle, which currently manages a circulating supply upwards of $23 billion, profits are accrued from the yield generated by the USD held in reserve at a bank alongside the mint/redemption fees charged for swaps at the issuer window. Naturally, as the outstanding liabilities of USDC increase, so do the reserves, generating a profit margin relative to Circle’s operational costs.

USDC’s peg parity is extremely robust to volatility due to its straightforward arbitrage incentive, a notion compounded by its premier liquidity across so many exchanges and fiat on/off ramps. Additionally, its sustained success and minimal peg variation foment a degree of faith that it will hold its peg among its holders. It’s a positive feedback loop. Finally, Circle’s cost of issuance is low since to mint USDC on Ethereum; it simply issues more ERC-20 USDC.

However, let’s examine the cost applied to custodial stablecoin peg maintenance in another area.

Custodial stablecoins are ostensibly bridges between TradFi and the crypto world. Since issuers like Circle hold reserves in regulated, real-world institutions, their custodian is much more vulnerable to directed regulatory actions. Maintaining a sufficient regulatory status to allay investor and holder concerns is a non-trivial cost — especially when issuers are relegated to playing regulatory arbitrage.

The costs of liquidating redemption deposits is also cumbersome and subject to fees and scrutiny not characteristic of crypto-native assets.

As a result, although maintaining a robust peg, Circle does so at a high cost (derived from its centralized issuance model) — one that is not censorship-resistant and prone to systemic collapse should regulatory action eradicate faith in its peg.

Non-Custodial Stablecoins

The original decentralized stablecoin model. Crypto-collateralized stablecoins take the concept of fiat-collateralized stablecoins, swap the fiat collateral for crypto, and transition the entire mint/redeem mechanism on-chain natively — no exposure to TradFi at all.

Crypto-collateralized stablecoins envelop their designs in the censorship-resistant properties of the blockchains. They are the first “blockchain-native” manifestation of stablecoins and are accompanied by some compelling ideas around economic coordination at scale over a permissionless network.

Crypto-collateralized stablecoins are represented by the flagship stablecoin deploying the model, DAI, which is issued by the MakerDAO smart contracts. DAI is considered an “exogenous stablecoin” since its primary collateral, ETH, has uses outside of the stablecoin’s peg maintenance — meaning ETH is not endogenous to the Maker system.

Maker is a money market built on Ethereum that enables depositors (e.g., lenders) to generate interest from borrowers. The rate is determined by continual adjustments of the supply-demand curve for borrowing. To issue DAI, a borrower opens a collateralized debt position (CDP) on Maker, where they lock-up collateral at a specific Loan-to-Value (LTV) threshold — receiving the proportionate newly issued DAI as debt for their loan.

DAI maintains its peg both through arbitrage incentives on various trading venues, where it’s very liquid in DeFi, paired with the supply-demand balance for DAI when CDPs are opened and closed. Opening a CDP mints DAI, and closing a CDP burns DAI — meaning that DAI’s demand is largely a function of the demand for trading the underlying collateral on margin, namely ETH.

Since the primary underlying collateral for minting DAI is ETH, a volatile asset, borrowers must over-collateralize their CDP positions at a specific ratio determined by governance. Currently, the minimum ratio is 150%, meaning that $150 worth of ETH (collateral) mints 100 DAI ($100) debt. As a result, Maker is capital-inefficient relative to custodial, fiat-collateralized stablecoin models that can issue/redeem stablecoins at a 1:1 ratio.

The mechanism of DAI issued as collateralized debt also induces scaling constraints since closed-cycle arbitrage is impossible. These scaling constraints typically manifest during market volatility, where Maker, as a lender, cannot respond to market swings adequately in real-time (providing non-market rates) due to high gas rates.

The result is that lagging liquidations either instantiate zero-bid auctions during extreme volatility or execute rapid, cascading liquidations of ETH collateral once the keeper system receives accurate market prices. A system shortage of collateral-backing the system results (in the case of March 2020, 5.5 million DAI), spiking the DAI peg to around $1.10 and stirring fear of the “Death Spiral” characteristic of undercollateralized exogenous stablecoin models.

To dampen negative externalities caused during market volatility, when ETH positions are liquidated, and the corresponding DAI is burned, why not introduce less-volatile collateral that has the added benefit of also improving collateral optimization?

Well, Maker has done just that. Maker has introduced other collaterals (namely, USDC) into the system to alleviate the problems experienced during excessive market volatility. However, the implicit trade-off (especially with USDC) is swapping out censorship-resistance for volatility robustness since USDC is a fiat-collateralized, custodial stablecoin issued by Circle. For example, USDC currently backs roughly 40% of outstanding DAI.

To further ease volatility concerns, Maker is even considering expanding USDC as a collateral type, effectively making the outstanding DAI supply analogous to “wrapped USDC,” where the system’s solvency is based on the dependency of USDC maintaining its peg.

Again, let’s revisit the cost of peg maintenance.

Since Maker is a money market deploying over-collateralization of outstanding DAI, peg maintenance costs are high — manifesting as an inability to scale, collateral inefficiency, and the need to incorporate custodial stablecoins as collateral to dampen the negative externalities of market volatility.

Even though DAI is stable under normal circumstances, the costs for rebalancing the peg during volatility are highly contingent on a lender (Maker) avoiding a shortfall event — a cumbersome process compounded by high gas prices on Ethereum.

On to the Next

So, we have custodial and non-custodial stablecoin models that both make explicit trade-offs to achieve peg stability. Custodial models are prone to the regulatory forces and systemic risks endemic in TradFi. In contrast, the over-collateralized, non-custodial stablecoin model cannot scale adequately because of its capital-intensive design.

But there’s more to the tale of stablecoins. The open frontier of deterministic stablecoin design, where the levers of a central bank are exported to the blockchain, made open-source, and enshrined in deterministic code — dubbed “algorithmic stablecoins.”

Algorithmic stablecoins are among some of the most intriguing monetary experiments in history. For the first time, real-world manifestations of “Hayek Money” and “Seigniorage Shares” currency designs are operating on public blockchains under the duress of real market forces. Not to mention, under the stress of the extreme market volatility characteristic of crypto.

Source — https://twitter.com/d0h0k1/status/1378835245538025478

You can’t ask for a better theater for their inception. Anonymous participants scouring open, permissionless, and decentralized Internet-native blockchains for a ripe opportunity to profit — where speculation, rapid innovation, and volatility run rampant. Where debt financing, socialized bailouts, and massive principal-agent problems of TradFi are eschewed for finality and skin in the game.

Blockchains are more than a crucible of money. They are accessible machines of institutional economic coordination. Money and DeFi just happen to be their most effervescent vehicle for social coordination striving for the net benefit of humanity. And algorithmic stablecoins are at the forefront of that experimentation.

Bitcoin offers the elastic supply stability and conservative, ideological bed from which to tilt at the existing shackles of central banking. Algorithmic stablecoins aim to replace the suits and ties in boardrooms entirely — ushering in a new era of decentralized currency.

We cannot examine algorithmic stablecoins and Terra without first providing a high-level overview of central banks and how they manage various aspects of fiat currencies, so let’s dive in.

Algorithmic Stablecoins — Eroding the Facade of Centralized Monetary Policy

Central banks have the exorbitant privilege of controlling a nation’s money supply, affecting all corners of an economy.

When the economy is booming, accelerating growth is the directive, and so central banks expand the money supply by easing interest rates and encouraging leveraged financing. If successful, leveraged financing achieves a multiplier effect on the newly created money’s impact on the economy’s growth. Raising rates follow when the economy is stable, humming along at a pace where the multiplier effect from monetary and fiscal stimulus dampens.

When the economy contracts, central banks apply numerous levers, such as dropping interest rates, curbing banking reserve requirements, and issuing short-term debt instruments to raise capital from the public — both domestic and foreign.

When growth is steady or booming, everything is sunshine and rainbows — seigniorage, the profits derived from printing money, fund fiscal expenditure to achieve a multiplier effect on money printed to stimulate growth.

However, there is the cost of contraction to the money supply during economic downturns, and even growth periods, where the prospect of inflation is an issue. Central banks have to absorb market volatility to defend against adverse collateral effects in the economy from the pegged currencies they issue. It’s precisely why central banks are currently exploring CBDCs.

Deterministic, calibrated adjustments of economic parameters are more effective than fax machines and suits in boardrooms.

Enter algorithmic stablecoins.

An intuitive way to think of algorithmic stablecoins is as open-source, algorithmic central banks.

Image Credit — https://medium.com/dragonfly-research/a-visual-explanation-of-algorithmic-stablecoins-9a0c1f0f51a0

Central banks in TradFi operate through the open market using various levers like cutting interest rates, curbing bank reserve requirements, and buying up treasuries (e.g., monetizing debt) to achieve a desired result. Directed action in the market has collateral effects across the interest rate curve, with the goal usually being the expansion of the money supply and stimulated spending and economic growth.

Algorithmic stablecoins deploy a similar model but replace the suits and ties in boardrooms with algorithms that ingest, calibrate, and dynamically adjust to market forces in real-time. As a result, algo stablecoins are designed to attain the trifecta of the long-term stablecoin goals without the trade-offs of the former two classes.

Primarily, this is accomplished via the “Seigniorage Shares” design of algorithmic stablecoins.

Rather than explicitly focusing on mint/redemption mechanisms to manage the elastic supply of the stablecoins, algorithmic stablecoins combine the mint/redemption mechanism with open market participation like central banks. They can operate with full reserves at a 1:1 ratio, fractional reserves, or no reserves at all.

Balancing the assets and liabilities is based on the protocol’s parameters. The internal mechanism design calibrates to outside market forces, such as the stablecoin trading above peg on a CEX, and adjusts accordingly. Despite their complex appearances, algorithmic stablecoins act in the same way as central banks, holding assets and liabilities, absorbing volatility in contractions, and distributing seigniorage to equity holders during periods of growth.

The difference is just that code replaces policy. Basis Cash, Fei Protocol, Empty Set Dollar, and Frax Finance are a few of the leading algorithmic stablecoins today. But many algorithmic stablecoin designs are largely contingent on speculation, not real-world adoption of a thriving DeFi ecosystem.

Enter Terra — the first and largest algorithmic stablecoin by market capitalization.

Mapping the Terra Protocol

Terra is an application-specific proof-of-stake blockchain using Tendermint consensus that’s built on the Cosmos SDK.

The Terra network consists of a suite of fiat-pegged stablecoins (e.g., UST), supporting atomic swaps between stablecoins at their current market exchange rate to achieve shared liquidity — a buffer against falling demand in one currency relative to another.

LUNA, the native staking and governance token of Terra, is defined as the “mining power” of the system that absorbs the short-term volatility of the stablecoin pegs while furnishing long-term, counter-cyclical incentives to stakers.

Terra’s stablecoins maintain their peg through a combination of a corruption-resistant, decentralized oracle system and open market arbitrage incentives — conservatively balancing liquidity parity between the on-chain swap mechanism and off-chain venue liquidity for LUNA and Terra stablecoins.

The goal is to constantly rebalance assets (LUNA) and liabilities (UST) to maintain UST’s peg parity with the Terra protocol acting as a market maker. Terra’s elastic supply model is contingent on LUNA, where the volatility of UST is traded for the supply-elasticity of LUNA — a market volatile asset.

The Terra Protocol is quite simple:

  • When the supply of Terra stablecoins (like UST) goes up, the LUNA supply goes down.
  • When the supply of Terra stablecoins goes down, the LUNA supply goes up.

The Terra protocol acts as a market maker with the on-chain swap mechanism using LUNA to make the market. Like central banks, Terra defends its peg with actions in the open market. But it does so indirectly via arbitrage incentives.

Most “seigniorage shares” algorithmic stablecoins follow a similar model but deploy more direct market activity, like Fei Protocol, which rebalances using liquidity on Uniswap. One explicit caveat also separates Terra — the Terra Protocol always enables on-chain swaps at the target exchange rate baked into the protocol, which is 1 UST for $1 worth of LUNA.

This is critical. Anyone can go to the market (i.e., the on-chain swap mechanism) and swap 1 UST for $1 worth of LUNA and vice versa. The on-chain exchange rate is fixed.

More succinctly, the on-chain swap mechanism enables the following:

  • Seigniorage — Minting 1 UST requires burning $1 worth of LUNA — contracting the LUNA supply + expanding the UST supply.
  • Contraction — Redeeming 1 LUNA requires burning 1 UST — contracting the UST supply + expanding the LUNA supply.

This is analogous to the issuer window of fiat-collateralized models like Circle, where the mint/redeem mechanism exists at a fixed rate regardless of market conditions exogenous to the issuer (e.g., the Terra protocol).

However, rather than redeeming fiat for the fiat-pegged stablecoin, users are swapping a volatile asset (LUNA) for a non-volatile stablecoin (UST).

This is a necessary feature of algorithmic stablecoins that want to perform open market operations under real-time market stress. It’s also what enables the “risk-free” arbitrage opportunity that helps alleviate peg discounts or premiums, where arbitrageurs leverage dislocations between the on-chain swap rate and UST price on the open market to pocket a profit.

Terra Seigniorage

If the increasing demand for UST causes it to trade above $1 on off-chain markets, arbitrageurs can burn $1 worth of LUNA to mint 1 UST on-chain, then sell the UST on the off-chain market (e.g., Kucoin) where UST is trading at a premium to pocket a profit. Off-chain spot selling of UST in this scenario drives the peg back down to $1. This process reduces the circulating supply of LUNA, which augments the per-unit value to LUNA stakers.

Currently, seigniorage in Terra is used to fund ecosystem growth by reinvesting the seigniorage generated during times of UST expansion. This mimics fiscal-spending fueled growth of the legislative or executive branch of a government. This is also a marked advantage over custodial stablecoin models, which cannot generate seigniorage since there is no profit generated from the creation of new money (UST).

According to Nick Platias in his “Introducing the New Terra Protocol” piece:

“The Terra protocol leverages seigniorage to achieve its twin goals of stability and adoption. Seigniorage allocated to mining rewards is a means of funding stability — it creates more stable demand for mining and thus stronger defense against Terra’s volatility. Remaining seigniorage is funneled to the Treasury, whose mandate is to stimulate Terra’s growth and adoption.”

In Terra, seigniorage is reinvested based on the Treasury_Weight module in the protocol, which adapts to different market conditions. In a standard scenario, the seigniorage is split as follows:

  1. A portion of the LUNA is burnt from the overall supply.
  2. A portion of the LUNA is sent to the Community Treasury.
  3. A portion of the LUNA is allocated to LUNA validators.

More succinctly, the excess seigniorage from the swap from LUNA → UST (expansion of UST supply derived from increasing demand) on-chain is used to fund the growth of the Terra ecosystem, where it is removed from the liquid supply and designed to achieve a multiplier effect on growth — where newly issued UST generates more value for LUNA holders.

Terra Contraction

If the demand for UST falls, causing it to trade below $1 on off-chain markets, arbitrageurs can buy 1 UST at a discount on the off-chain market (e.g., Kucoin), and then mint $1 worth of LUNA by burning 1 UST on-chain, to pocket a profit. Off-chain spot buying of UST drives the peg back up to $1. This process expands the circulating supply of LUNA, which dilutes the per-unit value of LUNA stakers.

Absorbing Volatility from Contraction

As you may have noticed, contracting the money supply has a cost — the dilution of LUNA holdings by expanding the supply. In central banking, that cost (i.e., absorbing volatility) is shouldered by the central bank via mechanisms like issuing bonds and short-term debt instruments, hiking interest rates, and more.

The clandestine point, however, is that the expansion of the US money supply gradually dilutes holders of US Dollars — primarily long-term savers. Should dilution outpace savings rates (the current situation), then holders of USD are incentivized to enter risk-on markets like equities to generate a return on their capital rather than being persistently diluted.

In Terra, that contraction cost is burdened by the LUNA validators. Because they have bonded large stakes of LUNA into the network (with a 21-day unbonding period), dilution of the LUNA supply negatively affects its price, causing drawdowns in the validators’ portfolios. Validators, on average, also hold the most LUNA, making them the most incentivized participants in the long-term health of the network.

This is the implicit cost that LUNA validators are willing to absorb in the short term. LUNA validators hold the belief that short-term volatility can be swapped for a longer-term, more appealing incentive.

LUNA is used as an immediate defense against UST price volatility by making the price for Terra at a fixed exchange rate based on the oracle price — the on-chain swap mechanism.

During a contraction, the system mints and auctions more mining power (LUNA) to buy back and burn UST. This contracts the supply of UST until its price has returned to the peg and temporarily results in mining power dilution.

Rather than explicitly collateralizing UST, however, the system finances Terra price-making via LUNA. UST volatility is consequently transferred to LUNA. The protocol adjusts its calibration of specific parameters to make long-term LUNA prospects counter-cyclical to the short-term volatility of the price peg that LUNA absorbs.

Hence, why the outstanding FDNV of the Terra ecosystem may be larger than the market capitalization of LUNA during intense periods of downward volatility. LUNA, not explicitly formulated to collateralize the outstanding liabilities of UST, can do so on a fractional reserve basis when necessary. LUNA just happens to get rekt more in the meantime until the system stabilizes.

More intuitively, the Terra protocol embeds longer time horizon calibrations into its mechanism design at the expense of short-term price volatility in LUNA. For LUNA stakers, they are implicitly aware of this trade-off and are willing to stake the LUNA regardless, aligning their incentives with the long-term adoption of the network.

They’re willing to do so because the long-term incentives of validating outweigh short-term volatility absorption.

Absorbing Short-Term Volatility

The Terra Protocol offers LUNA validators “stable mining rewards.” During contraction, real-time, counter-cyclical measures combat the contraction to ensure the continuation of stable mining rewards (e.g., cash flows to validators).

  1. LUNA validators are allocated bolstered staking rewards, resulting from increasing the tax rate on stablecoin transactions on the network.
  2. LUNA validators’ staking rewards are further augmented by increasing the on-chain swap fees for swaps from UST → LUNA (dampening the incentive to mint more LUNA on-chain simultaneously).

In the mid to long run, the protocol continues to buy back LUNA until the UST peg parity is reached. The overall result is predictable staking rewards under both expansionary and contractionary economic conditions.

The increased cash flows to LUNA validators are designed to nullify the dilution of LUNA during periods of contraction induced by market volatility in the long run by generating stable, linear growth of staking rewards despite the exogenous market conditions of the LUNA price.

For a recent example, we can simply examine what happened 2 weeks ago, when the UST peg was temporarily dislocated, trading at ~5% discount for 48 hours, and LUNA dilutions occurred as the protocol minted LUNA to buy back UST through the on-chain swap until the $1 UST peg was restored.

LUNA stakers suffered short-term losses arising from the dilution of LUNA to buyback UST as intended by the protocol.

Image Credit — https://terra.smartstake.io/history

Concerning staking rewards, notice how the revenue over time continued rising linearly for validators with the minimum LUNA amount to become a validator (3,500 LUNA) depicted below. Despite the short-term dilution of the LUNA validators, their staking rewards continue their progressive trajectory upwards despite exogenous market conditions. This is the stable mining reward mechanism that the protocol allocates validators to ensure that long-term incentives outweigh the short-term price volatility of LUNA. Validator rewards are predictable and independent of market cycles.

Image Credit — https://www.stakingrewards.com/earn/terra

Notably, staking rewards on Terra are also augmented by airdrops of projects building on the Terra network — used as a mechanism to bootstrap liquidity and reward long-term holders in the network, which further solidifies the long-term incentive mechanism to absorb short-term volatility.

In the mid to long run, as Terra’s ecosystem growth continues, validators will be increasingly compensated in the form of a scarcer LUNA supply since, with Columbus-5, the protocol burns all the seigniorage (UST) generated by the increasing demand for Terra. Remember, UST grew to a $2 billion+ market cap with only 2 applications using UST. There are currently dozens of projects building on Terra that will use UST in a meaningful way.

The latter point is also extremely important to clarify. Other algorithmic stablecoins’ demand is contingent on speculation, as they do not form the locus of demand for an ecosystem of apps that captures value like Terra does. As long as Terra’s rapidly growing suite of products, tooling and user set increases, the demand for UST will expand, inducing net seigniorage in the long run, even if the growth is marked by short bursts of market volatility that trigger contraction.

Terra’s resiliency is fortified by the broader notion of permissionless, open protocols relative to TradFi. When LUNA’s price fell sharply from compounding liquidations on Anchor, triggering contraction, the peg still recovered within 48 hours.

Crypto experienced a massive VAR shock, a black swan, and nothing happened. No protocols failed, the system didn’t break, socialized bailouts did not occur. Leveraged speculators lost money, protocols adjusted, DeFi kept churning, and Terra’s community of builders kept building.

It was a natural reset of an overheated market rife with too much borrowing to capture larger profits on margin. Regardless, the volatility was handled valiantly by the Terra Protocol despite massive cascading liquidations and severe market contraction.

With the on-chain swap capacity via Prop 90 set to handle $100 million at 2% spreads, Terra can handle even larger contractions with ease.

As the redemption capacity is continually adjusted to maximize on-chain liquidity while still ensuring that it’s still less than off-chain liquidity (perhaps even algorithmically using parameters like indexed volatility), then Terra’s protocol can absorb massive amounts of contraction without such reflexive volatility on the LUNA price experienced several weeks ago.

But let’s also revisit Terra’s on-chain liquidity mechanism at a more granular level.

On-Chain Swaps — Oracle Manipulation Security

Prop 90, Jump Trading’s second on-chain liquidity parameters proposal for Terra, again highlighted the idea of maximizing the redemption capacity of the on-chain swap mechanism while conservatively accounting for the possibility of oracle manipulation attacks.

Notably, the on-chain swap mechanism has explicit parameters designed to:

  1. Maximize on-chain liquidity relative to off-chain liquidity.
  2. Protect against oracle manipulation attacks.

The above parameters are designed to allow the fixed exchange rate on-chain redemption capacity to scale to meet the accelerating liquidity of LUNA/UST off-chain. To secure the network from oracle manipulation:

On-chain liquidity < Off-chain liquidity

You’ve probably heard of oracle manipulation before. If you read REKT News, you’ll realize that a progressively larger set of “economic exploits” of DeFi protocols are conducted via flash loans that chain multiple transactions together to manipulate the price of an oracle on one venue and then profit off the price disparity on another venue.

Since the on-chain swap mechanism is baked into the Terra protocol, manipulating the oracle price to dilute LUNA holders means inducing an arbitrage opportunity off-chain and using the on-chain swap as the exit strategy. To clarify this, let’s first define some parameters.

The primary on-chain swap parameters include:

  1. Minimum on-chain swap spreads of 0.5%
  2. Tobin tax is variable with an average rate of 35 basis points (BPs).
  3. On-chain liquidity redemption threshold of $20 million per day at 2% spreads with spreads increasing exponentially after that — incurring an excessive loss.

The minimum on-chain swap spread of 0.5% is designed to stop front-running attacks when liquidity is low. Originally, the minimum spread was 2% and has been lowered to 0.5% as LUNA liquidity has increased. For more details about the Terra SDR cross-rate arbitrage trade, please refer to this article.

The tobin tax, which is variable and has an average rate of 35 BPs, penalizes short-term currency trading in order to stabilize markets and disincentivize speculation.

Finally, the on-chain redemption threshold of $20 million per day at 2% spreads is not a hard cap. Instead, it’s a threshold from which spreads begin increasing exponentially, making on-chain swaps past the on-chain liquidity capacity incur untenable losses. So, you may be wondering, why not just increase the on-chain redemption capacity beyond $20 million?

Well, let’s go back to the oracle manipulation exploit.

Remember, on-chain liquidity needs to be slightly less than off-chain liquidity. This means that the liquidity of LUNA/UST needs to be larger outside of Terra’s blockchain on third-party venues like Kucoin, Curve, etc. than via the on-chain swap mechanism baked into the protocol.

The reason is to reduce the attack surface by oracle manipulation of whales while commensurately maximizing the elasticity of Terra’s stablecoin float — it’s a careful trade-off.

From Jump:

“Conservative on-chain parameters can help protect the system from being bled by arbitrage or manipulation, but can also put a pretty strong cap on how much the float of Terra stablecoins can be increased/reduced by in a given time horizon.”

As off-chain liquidity for LUNA/UST increases, it becomes necessary to calibrate the elasticity of the UST float while maintaining robust security assumptions. However, let’s run through an example of when the liquidity on-chain > liquidity off-chain, pretending 1 LUNA = 1 UST. Note, we will not explicitly account for slippage or trading fees.

For a whale trying to manipulate the oracle price hypothetically, they would:

  1. Bid off-chain reference markets up without too much size, pushing up the LUNA/UST oracle price.
  2. Sell LUNA → UST on-chain at the increased Oracle price.
  3. Dump LUNA on the off-chain reference market to bring the Oracle price back down.
  4. Buy LUNA on-chain (UST → LUNA) at the lower Oracle price rate.
  5. End up with more LUNA, diluting other holders.

At a more intuitive level, the following steps are executed in sequence:

Raise LUNA price off-chain -> Sell large amount of LUNA on-chain at high price -> Lower LUNA price off-chain -> Buyback LUNA on-chain at the reset lower price.

Make profit, rinse and repeat.

The above trade is profitable without an on-chain limitation as the whale can go from off-chain manipulation → on-chain profit repeatedly. With an on-chain limit (in the form of untenable losses from an exponentially accelerating spread), however, the size at which the whale can go from UST → LUNA has an upper bound.

As a result, manipulating reference market prices off-chain becomes fundamentally unprofitable. From Jump:

“Having higher liquidity off-chain vs. on-chain makes it so that the above attack is unprofitable as it takes more capital to move the price than you can try to exchange on-chain.”

If there were no on-chain liquidity limit in a given epoch, oracle manipulation would be possible to execute repeatedly, dismantling the system’s on-chain security — diluting LUNA holders continuously. Hence, why on-chain liquidity parameters are configured to maximize the on-chain redemption capacity (and stablecoin float) without sacrificing security.

In the attack described above, if on-chain liquidity < off-chain liquidity then to manipulate the prices of the oracles on-chain, it would cost more to move these prices up and down than the profitability of the attack described. To accomplish this, the off-chain liquidity curve needs to be adjusted to maintain parity with the on-chain liquidity curve where the on-chain curve is always equal to or slightly more conservative — rendering oracle mispricing attacks fundamentally unprofitable.

Source — https://agora.terra.money/t/liquidity-parameters-2/1175

Jump’s Prop 90 accomplishes this via the following:

  • Expanding the on-chain base pool size (denominated in SDR).
  • Reducing the PoolRecoveryPeriod Parameter (effectively enabling on-chain liquidity to operate at reasonable slippage that scales to the off-chain liquidity ADV)

Since Jump’s first proposal, where the parameters were updated to $20 million in redemptions, the off-chain liquidity of LUNA has increased roughly 30X. As a result, on-chain parameters need to be scaled up — accounting for increasing off-chain liquidity.

Without sufficient on-chain liquidity conservatively matching the expanding off-chain liquidity, LUNA cannot sufficiently absorb extreme volatility, dislocating the UST peg. Had Prop 90 already been live during the past weekend, volatility from excessive LUNA liquidations on Anchor would’ve been adequately absorbed on-chain, maintaining the UST peg.

The silver lining is that the 30X increase in off-chain liquidity reflects Terra’s growth and expansion across CEXs and DeFi. It’s a positive sign. Subsequently, calibrating the on-chain liquidity parameters to match that growth comes to the forefront.

Understanding how various levers of the protocol and its ecosystem of apps interact at such a scale crystallizes during excessive volatility that spotlight points of pressure in the system. As the UST peg normalized, this was a function of the on-chain liquidity absorbing the volatility off-chain gradually, and as we said, it would not happen overnight.

Two weeks later, the Terra protocol is humming along once again, with the UST market cap growing 6% MoM despite the massive contraction induced by the extreme market volatility.

Remember, the demand for UST is a function of the demand for Terra’s ecosystem, since UST acts as a lynchpin for transacting across the network and using applications like Mirror and Anchor Protocol. This differs significantly from many other algorithmic stablecoins based on speculative demand since UST’s demand is derived from applications enveloping the internal protocol’s mechanism design.

Pioneering the Horizon

The meteoric ascendance of DeFi and all its accouterments, including algorithmic stablecoins, would simply not be possible without passing through the gauntlet of volatility duress derived from the auspices of rapid prototyping and permissionless networks. The necessary growing pains are learned from, improved upon, and wielded to build something better.

Stablecoins are the golden goose of monetary experimentation, something Friedrich Hayek portended when he uttered the words:

“I believe we can do much better than gold ever made possible. Governments cannot do better. Free enterprise, i.e., the institutions that would emerge from a process of competition in providing good money, no doubt would.”

That vision was realized when an anonymous founder, Satoshi Nakamoto, unveiled the Bitcoin Whitepaper to a small mailing list of cypherpunks, unleashing a torrent of revolutionary financial exploration.

Replacing the vaunted guard of central banks, enwrapped in political asymmetries, with accessible, decentralized, open-source protocols is not for the faint of heart. Terra’s protocol is a living organism. It’s not in its final state, nor will it be as long as a vanguard of community supporters, builders, and even critics contend to unseat the current monetary hegemony.

Algorithmic stablecoins fulfill the currency mandate of cryptocurrencies while retaining the censorship-resistance of the underlying blockchains securing them. They enshrine the features of decentralization, robust peg assurances, and a low cost of issuance into community-controlled code that has the power to make the mass adoption of cryptocurrencies possible.

There will be bumps along the road, but we foray into the unseen to illuminate the path that will onboard the financially disenfranchised into a more inclusive financial system — one not handcuffed by suits in boardrooms, political squabbles, or centralized control.

This is Terra, and our goal is to set money free. Welcome, fren.

— — —

Thanks to Stanford Liu and Irene Lee for their valuable input and feedback in the creation of this piece.

Addendum:

The original version of this piece contained a snippet derived from the Terra Whitepaper that the Terra Protocol will continue to buy back LUNA until the UST peg parity is reached with an upper bound of a 1 billion LUNA supply cap. The 1 billion LUNA cap from the original protocol’s whitepaper is outdated, as LUNA dilution can theoretically continue until a discounted UST peg is restored to its $1 parity. The piece has been updated to reflect the change.

--

--