Credits to the proper student to made this guide: @Y2z3H, thank you for this guide!
KOVAN Testnet: A DeFi deep dive
Treat this as a guide only! This guide is my own personal experience of using the Kovan testnet and it may serve as a calm starting point for anyone who is trying to get involved with DeFi through the testnet.
Anything you decide to do beyond this walkthrough is entirely your responsibility and any losses or glitches you come across is not my fault! I am not a professional nor am I a financial advisor! It’s important that you know the risks of crypto and do your own research before diving into DeFi
In this guide, I will show the steps I took when using Kovan ETH to make a collateralised debt position (CDP) using the Oasis borrow app, and using the DAI generated to put into the chai.money savings app.
4). Oasis borrow app
- I am first welcomed with this prompt to verify my account by signing a message:
Sign the message:
Accept the T&C’s:
Now you’re good to go!
- Now it’s time to open a vault so that we can create a CDP to generate DAI!
After clicking on “open new vault” on the top of the screen, you’ll be taken to this page:
During my tests, I opted to open a vault with Ether because it’s the only asset I had:
- Configuring the vault
This part was a bit tricky to get my head around because I had to deposit ETH and generate a minimum of 100 DAI (since that’s the required amount needed to open a vault). The catch was to deposit an acceptable amount of ETH, which enabled my collateralization ratio (CR) to be at a good level.
The CR on this amount is way too close to the minimum CR (150%). I am pretty sure that if I was to make this transaction on the mainnet, my position would be soon liquidated:
This CR on the deposit amount is ok, since it is green, however, on the next price update, if we were on mainnet, the updated CR would be close to 150%, which increases chances of liquidation:
I spent a while playing around with the numbers to see which deposit amount would make the warning disappear, and found the following to have worked:
So with that amount, with a decent CR, I now go to confirm the transaction, and then go on to create the vault:
Confirm the transaction on MetaMask:
Boom! I have now created my Vault on Oasis!
Now by clicking on “Go to Vault # 4209” it takes me to this screen, where I now have a balance of 100 DAI, which I can spend however I want:
With this newly generated DAI, I’m now going to deposit in the chai.money app!
- Saving with Chai.money
By navigating onto the chai.money app, I can see my balance of 100 DAI, whoch I was able to generate through the CDP I made on Oasis:
I want to turn my DAI into CHAI, so that I can earn 0% APY, so I simply put in an amount of DAI I wish to convert:
Then, by clicking convert, I am asked to allow the chai.money app to spend my DAI:
After I confirm, I now need to confirm the actual transaction which will convert my DAI into CHAI:
Now, I have 83 CHAI and 17 DAI!
- Paying back my loan
After doing all of this, I decided that it’s finally time to pay back my loan and turn all my assets back to ETH.
- First, I want to turn my CHAI back into DAI. In order to do this I need to withdraw (or “Draw” my CHAI in order to convert it back into DAI.
So I look at my total balance (83 DAI) and click convert.
However, when I clicked convert, something mad happened:
This error comes up! Now ofc, I tried to click confirm, thinking that this was just a random glitch, but when I do, the transaction fails:
Yes I tried refreshing my browser, closing and reopening metamask, but this error still appears…
I was wondering for a while, how could this be? I have 83 DAI deposited in Chai.money and I want to withdraw 83 DAI… however, it dawned on me, I technically don’t own 83 DAI. It is my CHAI, that I now own, that is worth 83 DAI which is reflected in my balance. For some reason, the app doesn’t display my CHAI balance, but there is a way to see it and convert it back to DAI.
To find out the CHAI balance, I opted to interact with the smart contract on etherscan (there is a much simpler way, which I found out just now as I’m typing this, but since this is my journey, I will explain the long way xD
- At the bottom of the page, I saw the Kovan CHAI contract address and once clicking on it, I was taken to the address page on etherscan:
CHAI contract address:
CHAI token page on etherscan:
- Whilst still on the CHAI page on etherscan, I now need to go deeper into the contract and find out my balance. To do this, I clicked on:
Contract --> Read Contract -->
balanceOfthen I pasted my address into the input field:
As you can see, the amount of CHAI I have in my account looks huge! But to find the true amount, we have to multiply the balance by 10e-18, since most tokens use 18 decimals. So my balance in CHAI is 81.996…
A more efficient way to see your CHAI balance is to simply go onto your MetaMask and click on “Add token”:
Then paste the Kovan address for CHAI (found at the bottom of the website):
Once you click “Next”, you will now see your CHAI balance and will be able to add it to your MetaMask account!
Now I know the balance, I can now reliably withdraw the correct amount of assets from the Chai.money app:
I noticed I have 1 DAI worth of CHAI left in the app, so I am going to remove all of it:
I now noticed that I have 99.98 DAI, but I need 100 DAI in order to pay back my loan… The CHAI token is worth slightly more than DAI, and because the chai.money app won’t let me convert all of my CHAI to DAI (because it doesn’t convert small balances into DAI) I am left over with the balance which is slightly lower than what I originally deposited. (I hope this made sense xD)
Because of this, I am now compelled to go onto Uniswap and use the remaining ETH I have to purchase some DAI:
So I go onto Uniswap, and swap some ETH in order to get 0.1 DAI
I do all the confirmations and now have 100 DAI:
Now it’s time to pay back the loan!
In this image, I am back onto the Oasis borrow app and am now withdrawing my ETH collateral, plus paying back the DAI I borrowed in the same transaction (This apparently saves on gas fees)…
So I confirm the vault changes:
Do all the MetaMask confirmations:
And I have paid back my DAI debt!
However, I still have ETH which is still deposited for some reason idk about, so I’ll simply withdraw it:
Now that my vault is empty, my DeFi journey on the Kovan testnet has come to an end…
I think I have some DAI on the Oasis save app but I genuinely can’t be asked to show how to withdraw it, as it is pretty straightforward. Refer to the first part of the guide and go back onto the save app in order to follow along the withdraw process.
Once again, thanks so much for reading and I hope that this guide can make someone’s experience a little bit smoother when it comes to interacting with DeFi using the Kovan testnet!