The complete tutorial for the CDL Loans Yeld dapp

YELD
8 min readApr 19, 2021

In this tutorial you’ll learn all the functionalities available to you in the new Yeld loans dapp so you can safely begin to use it and get the most out of your money.

Each feature has been carefully created to innovate from what currently exists in lending DeFi with things you won’t find anywhere else.

Here’s the index of contents you’ll learn in this complete tutorial:

  1. How to start using the CDL Loans dapp
  2. How to stake a coin and earn an APY
  3. How to check your earnings from the staked coins
  4. How to borrow tokens and repay loans
  5. What is the Crypto Score and how to use it
  6. How to earn money by closing expired or under-collateralized loans

Let’s get started!

1. How to start using the CDL Loans dapp

The yeld loans dapp is currently deployed on the Binance Smart Chain and will be launched soon to the Ethereum blockchain, to Matic and to the xDAI networks.

To begin using it, you’ll need to configure your Metamask wallet to use the BSC network. Here’s a short tutorial on how to do just that: https://academy.binance.com/en/articles/connecting-metamask-to-binance-smart-chain

Once your Metamask wallet is configured to use the BSC blockchain, open the dapp by going to yeld.finance and navigating to the “Loan” section:

If you’re not connected to the right network on Metamask, you’ll see a popup with the following message:

In that case, all you have to do is change your Metamask network to BSC and reload the page. Once the dapp has been completed loading data from the blockchain you’ll see an initial message with some important warnings and considerations that you should read before interacting with it.

That’s it! You can now begin to use the Collateral Decreasing Loans dapp.

2. How to stake a coin and earn an APY

The 2 main functionalities of any lending dapp is to stake funds to earn an APY and to borrow funds to get tokens for whatever purposes you may want.

To stake and start earning borrowing fees, click on one of the assets currently available in the Assets section to expand it like so:

The left section inside the opened asset is where you supply or withdraw tokens and the right section is where you get or repay loans.

In this case we’re only interested in the left section. So in order to stake a coin simply input how many tokens you want to add from your available balance and click on Supply. Alternatively you can click on the underlined numbers or the MAX button to setup the amounts automatically:

After that simply click on Supply to add tokens or Withdraw to extract those tokens. Note that if you get a loan, a portion of your liquidity will be locked and you won’t be able to withdraw it until the loan is repaid fully.

You’ll receive 1 or 2 Metamask notifications to approve your tokens to the smart contract and then to deposit them.

3. How to check your earnings from the staked coins

Whenever you stake funds and someone borrows those tokens, you earn a percentage of the interest rate paid for that loan, distributed among all the liquidity providers.

Let’s say someone gets a loan for 10,000 USDT with an interest rate of 5%. The loan is repaid on time. As usual, half the fee goes to the Crypto Score and half of it to liquidity providers. In this case the 2.5% of 10,000 USDT, which is 250 USDT, will be distributed to every liquidity provider based on how much they have staked.

Assuming you own a 10% of the tether pool, you’ll get 25 tether whenever the loan is repaid. You’ll see your increased balance right on the interface so you’re able to withdraw it as long as you don’t have any loans open.

4. How to borrow tokens and repay loans

To borrow tokens first open an asset block to see the advanced options. The right section shows you the borrowing options:

The first 2 lines indicate how many tokens you have borrowed and how much time you have left to repay them. If you don’t have any loans, you will see them as zero.

Next, the borrow limit line indicates how many tokens you can borrow. You can always borrow less tokens than what’s indicated. The Borrowed section simply shows you how many tokens you have borrowed right at that moment.

Now to borrow tokens first you have to click on the Borrow button to show the details:

In order to be able to borrow you’ll have to specify how many tokens you want and how much time you need to repay the loan. You can specify from 1 day to 365 days and the interest rate will increase the more days you reserve.

Then you’ll be able to repay the loan at any point during the reserved days by clicking on the Repay button. You can repay a portion of it or the entire loan, however it won’t be considered as closed until it’s fully repaid.

Remember that you’ll have to have another token as collateral. Your collateral is simply tokens that you’ve supplied as liquidity and are used as a security deposit in case you fail to repay the loan on time or the collateral value decreases sharply.

For instance, if you want to borrow 1,000 tether for 100 days, your fee will be a 7%. Meaning, you’ll have to repay back 1,007 tether at any point between when you started the loan and 100 days after. For that loan you’ll need 1400 USD worth of tokens supplied as liquidity that will be used as collateral.

If you’re still confused about the process of getting a loan simply follow these steps:

  1. Add liquidity by using the Supply button. It will be locked when you get the loan and you’ll be able to withdraw it after the loan is repaid.
  2. Click on the Borrow button to show the details and input how many tokens you want to borrow with the time to repay.
  3. Complete the process by clicking on Borrow again and confirm the Metamask transactions.

If you fail to repay the loan on time, your loan will be considered expired and any user will be able to consume it to liberate the funds borrowed.

5. What is the Crypto Score and how to use it

The Crypto Score is a number indicating how many tokens you can borrow with no collateral. For instance, if you have a score of 100, you’ll be able to borrow about 70 tether with no collateral at all, something not possible with traditional lending protocols.

It’s the equivalent of the popular credit score used by banks but in a fully decentralized protocol.

The great thing about it is that you can use it with your active collateral to increase the borrow limits exponentially.

To use it you don’t have to do anything, it will be automatically taken into consideration when borrowing tokens or when adding liquidity in a seamless way.

Note that if you have an active loan and it expires, you’ll lose your crypto score accordingly to however many tokens are consumed.

Your Crypto Score is very valuable because it allows you to get tokens at any point from the liquidity pool without having to lock any corresponding value.

Ideal for emergency situations and for people that want to trade, hold or short a token expecting a price movement so you can always participate in any market action going on at the moment.

It is always indicated at the top of the dapp:

6. How to earn money by closing expired or under-collateralized loans

Whenever a user borrows a token, he must use another or the same token as collateral so that there’s a guarantee for liquidity providers to get paid if the loan is never paid back.

Now there could be 2 issues when giving liquidity to a loan borrower:

  1. The loan is never paid back: The user that got the loan simply gets away without paying it and abandons the collateral used for the loan.
  2. The loan collateral value decreases: When that happens, the loan may be considered under-collateralized and will have to be closed to protect liquidity provider’s tokens.

To understand how a loan could become risky, take a look at this example:

Let’s say you want to borrow 100 tether while having a collateral of 0.3 BNB (worth about 140 USD), and the 0.3 BNB collateral suddenly drops it’s value to say 110 USD, at that point your loan will be considered under-collateralized.

Which means there is a risk that the borrowed 100 tether tokens become more valuable than the collateral itself. The last thing we want is to lend 100 tether just to receive 90 tether back.

That’s why under-collateralized loans must be closed to sell the collateral, convert it to the borrowed token and repay liquidity providers.

You can do so by interacting with the smart contracts directly or by using a premade script we’ve made for everybody to use and close expired and under-collateralized loans. The user that closes expired loans always gets a percentage of the profit from it.

Simply follow this short tutorial here (only for developers): https://gist.github.com/merlox/466dd89edf16c4783580f737b19e99a1

Conclusion

In this advanced CDL loans dapp tutorial you’ve learned everything you needed to know about how to interact with the lending protocol and some interesting mechanics to begin understanding the smart contract logic inside.

Feel free to start using the dapp at yeld.finance in the “Loan” section to earn liquidity provider fees or borrow tokens.

Stay up to date with feature announcements by subscribing to this medium publication and by joining our announcements telegram channel here: https://t.me/YeldAnnouncements

--

--