Flow: Borrowing coins
In order to borrow coins, the user must first obtain cTokens, described in the earning interest flow. Then the user must create an obligation
and deposit the cTokens into the obligation through the functions create_obligation
and deposit_ctokens_into_obligation
. It is possible to use any type of coin as collateral for borrowing any other type of coin. All loans are required to be overcollateralized. Some coins are weighted more than others in terms of borrow capacity consumed for borrowing that coin. This weight is configurable by the administrator.
Once the coins are deposited into an obligation
, the obligation
's capability object can be used by the user to borrow coins using the function borrow
. The user accepts a debt larger than the amount of coins lent out; there is a fee for borrowing, which is paid immediately with the borrowed funds.