Question about the Math in the dai to borrow for improving understanding. (related to Units) #654
-
So I noticed that in the aave_borrow.py code there is this line: amount_dai_to_borrow = (1 / dai_eth_price) * (borrowable_eth * 0.95) I understand that the answer is correct but I think I am not able to understand some parts of this math so I wanted to check what it is that I am thinking incorrectly. so, lets start with dai_eth_price now borrowable_eth, So when I try to do the math, So I am seeing that the unit of ETH does cancel out it becomes (ETH^2)/DAI I am very confused about what I am not understanding correctly. Much appreciated if someone can let me know :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
amount_dai_to_borrow = (1 / dai_eth_price) * (borrowable_eth * 0.95) For simplicity
The above code then means: Which is basically a way of saying: |
Beta Was this translation helpful? Give feedback.
For simplicity
borrowable_eth
is 0.8 ETHThe above code then means:
??? DAI = (1 / 0.001 ETH) * (0.8 ETH * 95%)
??? DAI = 1000 DAI * 0.76 ETH
??? DAI = 760
Which is basically a way of saying:
If 1 DAI is 0.001 ETH, meaning 1 ETH is 1000 DAI, how much DAI can I borrow with 95% of my 0.8 ETH?
1 : 1000 = 0.76 : ???
??? x 1 = 1000 x 0.76
??? = 760