Vaults
What you should know about this important feature on DeFiChain
What you should know about this important feature on DeFiChain
A vault is a digital space in your DeFiChain wallet that allows you to collateralize it with different assets to borrow other assets. It can be compared to a bank in traditional finance, except that there are no excess fees, credit does not matter, and the system is fair, near instantaneous, and objective. As mentioned in the previous tutorial, we will go in depth about this process and how it allows DeFiChain to mint the stablecoins and tokenized stocks.
Considering that vaults are decentralized and are digital, vaults must work differently than traditional entities like banks. In traditional finance, if you are trying to buy a $500,000 home, you can invest $100,000 in your home and ask the lender to pay the other $400,000, and over time hopefully you can pay the lender back. If you don't, the lender will take your house. In decentralized finance, if you borrow more than you have in collateral, you cannot be stopped from taking the borrowed money and leaving, so to borrow tokens, you always need more collateral than loans (at least $1.50 in collateral for every $1 in loans, to be exact), or else DeFiChain can use the collateral for payback purposes.
You are probably wondering, what are the APRs of these vaults? The answer is, it depends on how risky you make your loan. If the loan requires a higher amount of collateral compared to the loan (known as the collateralization ratio), then your APR will decrease. The minimum ratio as mentioned above, is 150% ($1.50 in collateral for every $1 in loans). Here are all of the loan schemes:
150% ratio: 5.0% APR (5.127% APY)
175% ratio: 3.0% APR (3.045% APY)
200% ratio: 2.0% APR (2.020% APY)
350% ratio: 1.5% APR (1.511% APY)
500% ratio: 1.0% APR (1.005% APY)
1,000% ratio: 0.5% APR (0.501% APY)
Now we'll talk about other vault mechanics.
When you create a vault, you'll have to pay 2 DFI. When you close your vault, DeFiChain will return 1 DFI and burn the other, so the more vaults opened and closed, the more coins are burned, also acting as a deterrent for creating too many vaults. It's best to only open one vault that never closes, so you don't have to pay again to open a vault.
After opening your vault, you will want to deposit collateral. It's important to note that when you have your collaterals deposited and locked, they are still decentralized, it is not sent to a company or a central location, simply locked in your wallet.
In addition to having the collateral required (which should be quite a bit higher than the minimum, or else you have a higher risk to be liquidated), your vault collateral also must consist of at least 50% DUSD or DFI when combined. If you fall below the ratio at any point, you will not be liquidated but you will need to replenish the ratio or else some vault features will be locked.
That's all of the requirements for borrowing using vaults. Now let's get into other details.
When you borrow tokens from a vault, you mint them based on the price of the actual asset, as opposed to the potentially higher or lower price on the DEX. There's no problem with that! Tokens are not pegged to the market, including DUSD at $1.00, instead, they were designed to free-float around their actual price. Additionally, it prevents regulatory scrutiny and allows users to try and "one-way arbitrage" to make a profit.
To determine the actual price for stock tokens, decentralized oracles receive tickers from sources such as Nasdaq and CoinMarketCap, and automatically aggregate them to create the price, known as the oracle price. This term is used often. To refer to the price on the DEX, you can simply use the term "DEX price."
Concerning market dynamics on borrowing tokens, when there is a premium on the tokens, users are incentivized to mint more tokens, creating more supply, and selling them into the open market, hopefully making a profit when they can buy back the tokens at a cheaper price to repay the loan. Oppositely, when there is a discount, users are incentivized to purchase the tokens in the DEX to hold and hopefully sell back later for a profit, or pay back their existing loans, reducing supply.
Where does it go?
As you know, borrowing tokens comes with paying interest for as long as you borrow tokens. However, there is no lender on the other side of the borrowing, you are simply minting tokens. So a reasonable question to ask is: Where does the interest, accrued in the token, go?
The answer to that is, on payback of the loans, the amount of tokens first borrowed is burned. If all minted tokens have been accounted for and burned any remaining is automatically converted to DFI and burned. (With the DUSD severe discount, however, the excess is currently being converted to DUSD and burned.)
DeFiChain vault liquidations work more like how a mortgage liquidation might work versus a market selling of collateral that occurs on an exchange. This section is about the criteria before a vault gets liquidated.
Remember the loan schemes:
150% ratio: 5.0% APR (5.127% APY)
175% ratio: 3.0% APR (3.045% APY)
200% ratio: 2.0% APR (2.020% APY)
350% ratio: 1.5% APR (1.511% APY)
500% ratio: 1.0% APR (1.005% APY)
1,000% ratio: 0.5% APR (0.501% APY)
The important part to pay attention to is the collateralization ratio. Once your vault falls below the ratio, your vault starts the liquidation process, so do not let your vault do that because you cannot add more collateral to stop the liquidation. If you are not already using the least collateralized vault ratio you can lower it before your liquidation, but after a vault liquidation begins you cannot lower it.
If you unfortunately get liquidated, your vault will enter what's known as an auction. If your collateral is valued at over $10,000 or so, or you borrowed more than one token, the auctioning will be split up into multiple different auctions.
An auction is just what it sounds like: users bid in order to gain control of your collateral, and their bid will be used to repay the loan. A vault auction lasts approximately 6 hours, as the time for an auction to finish is defined as 720 blocks.
In order to make sure that the auction proceeds will completely pay back the loan, a minimum bid is set. The minimum bid amounts to the number of tokens borrowed (need to be repaid) plus an additional 5% of that amount, known as the liquidation penalty and disincentivizes liquidations. This means that if someone bids on an auction, that means that the underlying tokens will be covered, because that bid already has enough to repay the loan.
Often, the minimum bid will have a lower value than the collateral, which means that people may bid higher. In that case, once the DeFiChain system burns tokens that needed to be repaid as well as the 5% liquidation fee, any tokens bid above that are credited back to the vault owner.
Every bid must be 1% higher than the last bid, to prevent users from adding tiny fractions of tokens.
I've gone over all the vault mechanics, so I'll go over how to actually make a vault now. For this tutorial I am only going to do a tutorial on creating a vault in the light wallet, as making a vault on the desktop wallet requires more technical knowledge. If you are considering making a vault in the desktop wallet, please ask in this group and you will receive help: https://t.me/DeFiMasternodes.
1. Open your wallet and go to the "Loans" page.
2. Click the "Create Vault" button or the "+" icon in the top right corner of the wallet.
3. Select your collateralization ratio.
4. Click "Continue" and finish your payment transaction.
Once you are finished, your vault will show up on the tab, just like this.
1. Go to your vault and click "Edit Collateral."
2. Add the collateral you want.
Your vault should now look like this.
3. Click "Manage Loans."
4. Choose a token to borrow. I have chosen to borrow DUSD. This is only for the purpose of the tutorial, it generally does not make sense to collateralize a vault with DUSD and borrow DUSD.
Your vault will finally look like this.
1. Select the token you need to pay back and click on "Payback Loan."
2. Choose the payback amount and repay your loan.
There are two ways that you can bid on an auction: you can do a quick bid, which will create a bid 1% higher than the current highest bid, or custom offer, which allows you to make your own bid. Here you will learn to do both.
1. Go to the auctions page, which is the fourth tab from the left.
This page will appear. If there are no available auctions, it will be shown on the screen.
2a. Click on the "Quick Bid" button.
3a. Finish the transaction. (Unfortunately for me, I do not have enough dMSTR to bid, so I cannot continue the transaction.)
2b. Click on the button to make your own bid, which is just labeled as "Place Bid."
3b. Type in the amount you want to bid and finish the transaction. If you change your mind, then inside of the text box, there is a button which will automatically input the minimum next bid.
Thanks for reading this tutorial! If you'd like to read more, the next tutorial discusses future swaps.