Error in lesson 10 (and following question) #49
-
Hi, in the lesson 10, in the repayAll(amount, lendingPool, account)
# check using print(getDaiGateway().balanceOf(account)) at the end of the script it should be: repayAll(Web3.toWei(borrowable_dai, "ether"), lendingPool, account) However at this point, if we check our account balance, we are not even. Infact, our balance will be How do we get those 0.1ETH back? because those 0.1 are not under some kind of ERC20 token or something else, but just probably in a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Great question. So we just repaid everything that we had currently borrowed. But even in that split second that we borrowed it, we accrued interest, and that's what you'll see in that Once you buy more DAI, you can use it to pay the rest of your DAI debt off. See this answer for the more verbose answer: #30 (comment) |
Beta Was this translation helpful? Give feedback.
Great question.
So we just repaid everything that we had currently borrowed. But even in that split second that we borrowed it, we accrued interest, and that's what you'll see in that
total_debt
varible. However, we don't have any more DAI to pay off that debt. To finish paying it off, we'd have to go buy more DAI first. This is a bit longer to explain, so instead, I have some scripts and code here that can show you how to "buy" more DAI in a forked environment. https://github.com/PatrickAlphaC/defi_py_mix/blob/main/scripts/swap/swap.pyOnce you buy more DAI, you can use it to pay the rest of your DAI debt off.
See this answer for the more verbose answer: #30 (comment)