How To Create A Stablecoin?

in LeoFinance4 years ago

I have been looking a bit into HBD trying to figure it out what are some of the options to improve its tokenomics. But before going into HBD I decide to educate myself a bit on the topic and take a look at the other stablecoins on the market. How do they work? Is there something more than what appears on the top?

01.png

If you think about it, what we call a stablecoin is actually a pegged coin to some other asset. There is nothing stable in the universe, let alone in the financial markets. The dollar is changing its value to the Euro, the Yuan, the gold, and most importantly to everyday goods as food, clothes etc.

This said whenever we say “stablecoin” in crypto it usually refers to a token that has a pegged value to the USD.

Why are stablecoins important?

If we take a look at the coins with the highest trading volume on some of the crypto aggregators like coinmarketcap or coingecko, we will see that it is not Bitcoin or Ethereum that is on the top but it is Tether. Yes, Tether is the number one crypto by trading volume. This alone tells us that stablecoins are very important for the everyday trading in crypto. They are used on the crypto exchanges for trading crypto and make it possible for markets to work.

The liquidity of the stablecoins in a way determines the liquidity of all the crypto market. If someone want to sell one billion in Bitcoin, there needs to be a one billion liquidity in stablecoins on the opposite side for this transaction to be possible. OTC deals are always happening but that is not the point here.

Nowadays we are seeing more and more ramps from fiat to crypto, meaning direct trading of say USD to BTC, that bypasses stablecoins, but still the major volume on exchanges is still in stablecoins.

What Types Of Stablecoins Exist?

In general, stablecoins can be classified into two categories:

  • Collateralized stablecoins
  • Non-collateralized stablecoins

The non-collateralized stablecoins or algorithmic (seigniorage supply) stablecoins are trying to keep their value true the control of the supply and the demand, usually with some automated expansion and contraction of the supply. More or less trying to mimic the central banks. There can be more than one token in the system, bonds, shares etc.

IMO (I can be wrong) these types of stablecoins are not very sustainable in the crypto industry. These types of coins might work better in already established and large enough systems that have acceptance and inertia. For new tokens, that have no proven records and no trust, you need a lot more than just controlling the supply to maintain value.

The collateralized stablecoins is usually where things are happening in the crypto industry. These types of coins usually have some collateral that is supporting them. Things can get interesting depending on the collateral. I general these type of coins can be:

  • Fiat collateralized
  • Crypto collateralized

There can be many other things that can be used for a token collateral, basically all physical stuff, like gold, other minerals, or even land and houses. But for the crypto world and the digital era, we will take a look a the most popular at the moment and those are the two above.

Fiat backed stablecoins are usually backed by reserves in fiat that the issuer of the token needs to hold. In the case of Tether or USDC, the issuer of the tokens needs to have the same amount of them in the bank. The problem with this is because these are private companies, centrally controlled that are issuing the coins it can be tricky at times to check their bank accounts, especially when dealing with international banking 😊. Some of them use services and are disclosing their holding, but again you can never be sure what will happen tomorrow with these holdings.

Crypto backed stablecoins instead of fiat are using crypto as collateral. Now the thing with crypto collateral is that crypto in general is very volatile. A crypto collateral of a 1$ value today can be worth 0.5$ tomorrow and the opposite. To compensate for this volatility there need to be more collateral than the 1$ atm. Usually this ratio is somewhere between 150% to 200% as a minimum. The next step is to create a smart contract platform where stablecoins with crypto collateral can be minted/created, under specific conditions. With crypto collateral and open source smart contracts, everyone can issue stablecoins.

The most popular stablecoin with crypto collateral is DAI, build on Ethereum. Although its not the only one, Bitshares introduced this ability as well and there is a semi stablecoin on Hive.

DAI is leading the way obviously with a 1.6B marketcap at the moment. It is right after Tether and USDC at the moment and it’s the only popular stablecoin that is backed with crypto collateral and smart contracts in a decentralized way. Let’s take a look how does DAI works.

How DAI works?

With crypto collateral and smart contracts duh 😊. This is the short answer. But how does DAI maintain its peg to 1$ and provides the security for a billion dollar stablecoin has a bit more details in it.

How does a stablecoin maintain its peg? Stablecoins are on open market where demand and supply determines the price. How can one remain pegged? Ultimately all stablecoins require a large buy and sell walls around the 1$ peg. Or if the peg is broken, an incentive so the buyers/sellers can step in and balance it out. Fiat backed centrally issued stablecoins achieve this by collecting capital (other crypto) and setting buy and sell orders on the exchanges. DAI however does it in a different manner. Let’s take a look.

DAI is a part of the larger ecosystem of MakerDAO. MakerDAO is a platform and a set of smart contracts on Ethereum that can create DAI tokens. One of the things that the Maker platform enables are vaults, where each eth address can create a vault, deposit collateral and generate/mint DAI. At first it started with Ethereum only as a collateral, but now every ETH token can be accepted by the protocol to create DAI. Although the token needs approval first from the Maker holders. At the moment of writing this there is more than 20 tokens that can be used to create DAI. More info on daistats.
MakerDAO is a smart contract platform and there can be more interfaces to it but one of the most popular ones is https://oasis.app/.

The Maker token is the governance token of the platform. The Maker holders vote for the rules under which DAI can be created. Some of them are for approving new tokens to be eligible for collateral, change the ratio of the collateral of the exciting tokens, vote on rewards and fees for creating DAI, etc. There are other things that are controlled by the Maker holders as well.

Volatility cannot be avoided it’s just transferred!

How does DAI transfer volatility?

  1. Over collateralized asset
    The first thing is with collateral. When a collateral of 150% is set it means there is a 50% buffer before this asset loose it value. Ethereum or other tokens need to drop more than that for DAI to lose value.

  2. Smart contracts
    The smart contract side of the MakerDAO protocol can be a bit confusing and complicated. I will just drop some of the aspects of it as bullets:

  • Collect collateral, mint DAI
  • Liquidate and sell the vaults where the collateral drops below the threshold (collateral auction)
  • Introduce a penalty for those who don’t keep their collateral above the threshold (liquidation fee)
  • Limit the amount of DAI that can be created from different tokens (debt ceiling)
  • Introduce a fee for creating DAI if the supply is to high (stability fee)
  • Introduce a reward for holding DAI if the supply is low (DSR)
  • Create a reserve fund from the fees and penalties paid that will be used in case of a market crash (Maker Buffer)
  • Mint and sell Maker for DAI to cover the loses in case of a Black Swan event (debt Auction)
  • Create a ceiling for the holding in the reserves after which DAI will be sold for Maker that will be then burnt (Surplus Auction)
  • Use all the above to incentives buying and selling at 1$ (Keepers)

More in the MakerDAO whitepaper.

Quite a lot of bullets. All the things above and more are coded into the smart contracts, plus price oracle plus more mechanics. The Maker holders can vote and change a lot of the metrics from that are triggering some of the things described above.

With the settings above everyone that is creating DAI under the conditions determine in the smart contracts, has an individual responsibility to keeps its collateral above a certain level. For example, I put 1 ETH in a collateral, that is worth 1300$. This will allow me to generate a maximum of 866 DAI. If I want to be on the safe side I will create a 650 DAI with 200% collateral. To take back the Ethereum I deposited I need to pay back the DAI first plus fees. Also, I need to monitor my collateral to not drop under 150% otherwise my vault will be liquidated with a liquidation fee of 13%. These numbers are different for different tokens and are set by the maker holders. In the example if Ethereum drops below 950$ (the price for a 150% collateral), my vault will be liquidated with a liquidation fee of 13%, and I will be left with less Ethereum that I put in (the generated DAI included).

Liquidating vaults is the first line of defense for the MakerDAO protocol. What happened in March 2020 when the ETH price flash crashed due to COVID 19, there was no one left buying the ETH from the liquidated vaults. When a vault is liquidated, the ETH is sold on internal auctions, meaning the price is not set, so the auctions can continue to go lower. In some of the cases there was no buyers and some of the ETH was sold for almost zero. Since then MakerDAO has introduced a buffer, or a buyer of last resort so to speak. If the auctions of the collateral do not provide enough assets, then funds from the reserves (buffer) will be used. If this fails as well then new Maker tokens will be mint and used to provide the additional needed assets. Basically, a two more layers of security and asset providers.


What can we conclude from the above in the case of stablecoins created with crypto collateral and smart contracts?

It is a protocol that allows everyone individually to create a stablecoin (take a loan), by depositing a crypto collateral under a certain conditions. The stablecoin is backed by more than 1:1 ratio in crypto assets because of the volatility in the industry. If the individual doesn’t maintain their collateral above the threshold and don’t pay back the stablecoin his position will be liquidated with a fee. The system has a security mechanics put in place if market crash or black swan event occurs. There is a reserve fund and second governance token that set the rules but also can be used in case of a need to generate more funds or to remove funds. There are incentives in place to put a buy and sell orders around the 1$ mark and fees to control the supply of the stablecoin.

How does HBD fits in the above?
Does it have a collateral? Is it an individual collateral? What is the ratio? How is HBD created in the first place? Are there incentives for buy and sell orders at 1$? Are there fees and rewards? ….

We will look a bit more in the HBD in the context above in another post!

All the best
@dalz

Posted Using LeoFinance Beta

Sort:  

Interesting read. Eagerly awaiting the next episode.

Thanks!

you should check out @edicted post about HBD as well. great post!

Thanks .... I have seen his post about hbd.... some interesting ideas and starting points :) Hope to go around them in a HBD post

really fantastic article and I appreciate your deep dive. I really never knew a lot of this stuff and I love the fact that you layed it all out for me. Especially DAO. I give the article a share on Noise.Cash because there are a lot of newbies over there that need to learn about stablecoins. We're not all crypto geeks!

Posted Using LeoFinance Beta

Can you give an example of a non-collateralized stablecoin? I am under the impression that all of them have some collateral backing the peg. Please correct me if I am wrong.

One minor correction:

The first thing is with collateral. When a collateral of 150% is set it means there is a 50% buffer before this asset loose it value. Ethereum or other tokens need to drop more than that for DAI to lose value.

A drop from 150% to 100% is a 33% drop in value of the token used as collateral not 50%:

(150-100)/150 = 0.33

Posted Using LeoFinance Beta

There is one called Basis, and I think it is not working now, also there is one new on the binance smart chain, called bDollar, BDO.

Thanks for the corection on the % ;)

Great Article! Just reblogged it and shared it. That is the kind of CONTENT we need!

Posted Using LeoFinance Beta

Can we just make one here... Call it stable coin? I'd buy some