# 💵 NUSD

Nibiru USD (NUSD) is the vehicle for simplifying the way users interact with stablecoins. NUSD's implementation lives inside NibiruChain/nibiru-wasm (opens new window).


# Wrapped Asset Problem

The "wrapped asset" problem in Web3 refers to the practice of creating tokens that are backed by another asset, typically a cryptocurrency or digital asset that exists on a blockchain. The idea behind wrapped assets is to make it easier to use existing cryptocurrencies and other digital assets in decentralized applications (dApps) that run on different blockchains.

For example, Ethereum-based tokens like ETH and ERC-20 tokens can be "wrapped" as tokens that are compatible with other blockchains like Binance Smart Chain (BSC) or Polygon. This allows users to easily move their assets from one blockchain to another without having to go through a complicated process of converting one type of cryptocurrency to another.

However, the wrapped asset problem arises:

  1. When the value of the underlying asset (i.e. the cryptocurrency or digital asset that backs the wrapped token) is not equal to the value of the wrapped token itself. One instance of this ocuring was with BitGo's ERC-20 version of Bitcoin, WBTC, in 2022 (opens new window).
  2. When there are too many versions of the wrapped asset, leading to liquidity fragmentation and potentially security risks. Liquidity fragmentation can also lead to increased volatility in the market, as different trading venues may have different levels of liquidity and different prices for the same asset. This can make it more difficult for users to predict the value of their investments and increase the overall risk of the market.

# Rationale 1 - Solving the Wrapped Asset Problem

NUSD is primarily responsible for one thing, and that is to simplify the interface through which users of Nibiru operate with dollar-pegged stablecoins.

To understand what this might mean, consider the case where USDC is the quote asset on a Dapp like Nibi-Perps. Which USDC is the USDC? Should users simply be allowed to open postions with nobleUSDC (from Circle's CCTP), ceUSDC (Celer Network), axlUSDC (Axelar), gUSDC (Gravity), or USDC-Wormhole? And if so, what would the user get back when closing the position?

How about when the USDC from the same bridge comes from different chains? Wormhole USDC from Polygon isn’t the same asset as the when the token comes from Arbtitrum, even though both tokens be bridged through Wormhole Gateway. When this bridge is connected to Nibiru, we wouldn’t want to disallow Polygon-Wormhole-USDC in favor of the other. It’s a tricky UX problem in Web3, and not necessarily unique to Nibiru.

# Rationale 2 - Removal of the "Algo" from stablecoin

Algorithmic stablecoins use a variety of different mechanisms to maintain price stability, but they generally involve the use of algorithms to adjust the supply of the stablecoin in response to changes in demand. For example, if demand for the stablecoin increases, the algorithm may increase the supply of the stablecoin to maintain a stable price.

# Brief refresher on algorithmic stablecoin designs:

  • Seignorage: One common type of algorithmic stablecoin is the seigniorage-style stablecoin, which maintains price stability by adjusting the supply of the stablecoin in response to changes in demand. Seigniorage-style stablecoins typically operate by minting new coins when demand increases, and burning coins when demand decreases, to ensure that the price of the stablecoin remains stable.
    • Examples: Magic Internet Money (MIM), TerraUSD (UST), Basis Cash (BAC), Empty Set Dollar (ESD).
  • CDP: Another type of algorithmic stablecoin is the collateralized debt position (CDP)-style stablecoin, which maintains price stability by using a system of smart contracts to manage a reserve of collateral assets. CDP-style stablecoins typically use a basket of different assets to maintain price stability, and they adjust the amount of collateral required to maintain price stability in response to changes in demand.
    • Examples: DAI

Frax is a bit of a special case in that it maintains its price stability through a combination of algorithmic and collateral-based mechanisms.

# Observations

... 🚧 Under Construction 🚧

# Background: NUSD v0 Design [DEPRECATED]

Up until Summer of 2023, NUSD was essentially developed first as a fork of Frax V1 implemented in a Cosmos-SDK module. We moved away from this to our own novel approach to better stablecoin UX with NUSD smart contracts. This background section is just here for completeness.

The V0 design (DEPRECATED) is implented in the x/stablecoin module (opens new window) of the chain.

In this model, NIBI acted as the FXS and analog and NUSD acted as FRAX. NUSD followed Frax's mint and redeem constraint equation(s):

Copy 1 NUSD = 1 NUSD worth of assets amtUSDC = CR * amtNUSD / priceUSDC amtNIBI = (1 - CR) * amtNUSD / priceNIBI amtNUSD = amtUSDC + amtNIBI

where the amounts amtUSDC and amtNIBI come from the exchange rate of NUSD against both USDC and NIBI, respectively, and the collateral ratio (CR) is a number between 0 and 1.

For example, if:

  • 1 USDC is worth 1 NUSD,
  • 1 NIBI is worth 10 NUSD
  • The collateral ratio (CR) is 90%

Then, minting/redeeming 200 NUSD requires an exchange of 180 USDC (200 * 90%) and 2 NIBI (worth 20 NUSD).