Publications

Lending and borrowing in Decentralized Finance

Lending and borrowing in decentralized finance

One of the largest verticals inside the DeFi space is lending and borrowing. The three major protocols operating in this part of the industry are Aave, Compound and MakerDAO. Below, we will examine MakerDAO and Aave as Compound was already briefly introduced in the larger publication about DeFi.

At the start of its existence, MakerDAO’s goal was to issue a stablecoin, DAI, that is pegged 1:1 with the USD. The procedure is as follows, the user deposits ETH into a MakerDAO “vault”. In exchange for this, the user gets rewarded in DAI. The mechanism only works on an overcollateralized basis. To visualize it better, let’s use a simple example.

User deposits 1 ETH worth $400 from which he can get 200 DAI in return at a 200% overcollateralization ratio. The user essentially takes out a loan in DAI by depositing ETH. Two things can happen afterwards. Either the Ether price can appreciate upwards, for example to $600. The user now has an overcollateralization ratio of 300%. The user can then take out an additional 100 DAI as a loan bringing their collateral ratio back to 200%. The other possibility is that the price of ETH depreciates. The user either can now deposit additional Ether in order to stay at a similar collateralization ratio. However, if the user fails to cover the required collateralization level, he gets liquidated. This means that the collateral of the user is picked up by a liquidator (a peer of the user) which closes the loan automatically.

One potential use-case MakerDAO is that the user can spend the DAI without having to sell their ETH. Thus, the user is still having an exposure to the potential upside of the ETH price. As a result, the user can create “leveraged” long exposure to ETH. By using the 200 DAI received from the first loan the user can buy 0.5 ETH (200DAI / $400) and take out another loan on the 0.5 ETH of 100 DAI. Rinse and repeat the same process as the user buys another 0.25 ETH for another loan in DAI creating even more leverage than before.

The MakerDAO system is a DAO because it is governed by the Maker holders. Their decisions include a wide range of topics, for example, what type of assets to allow as collateral inside MakerDAO. Maker holders also decide on the crucial parameter for the MakerDAO ecosystem, namely the stability fee. This fee is charged to users taking out a loan which is used to maintain the 1:1 USD peg. The diagram below, presents how it works in practice.

 

At its core, MakerDAO is like a credit facility that issues loans with a certain interest rate. If the interest rate (stability fee) is low, people are encouraged to borrow more (lock up more ETH). If the interest rate is high, the cost of capital is high making it less attractive to the borrowers. Therefore, higher stability fees cause less loans being taken which reduces the number of DAI on the market. The same is true with the opposite, lower stability fees incentives to take more loans which increases the number of DAI on the market.

Aave

Aave is perhaps best described as a system of lending pools. Users deposit funds they wish to lend, which are then collected into a pool. Borrowers may then draw from those pools when they take out a loan. These tokens can be traded or transferred as a lender wishes. To facilitate this activity, Aave issues two types of tokens: aTokens, issued to lenders so they can collect interest on deposits, and Aave tokens, which are the native token of Aave. The Aave cryptocurrency offers holders several advantages. For instance, Aave borrowers don’t get charged a fee if they take out loans denominated in the token. Also, borrowers who use Aave as collateral get a discount on fees. Furthermore, Aave owners can further look at loans before they are released to the general public if they pay a fee in Aave tokens. Borrowers who post Aave as collateral can also borrow slightly more than with the other types of collaterals.

The key differentiator of Aave platform are the flash loans which do not require an upfront collateral and happen almost instantly. How is that possible? Flash loans take advantage of a feature of all blockchains, which is that transactions are only finalized when a new bundle of transactions, known as a block, is accepted by the network. Adding each new block takes time. On Bitcoin, that interval is roughly 10 minutes. On Ethereum, it’s 13 seconds. An Aave flash loan therefore takes place in that 13-second period.

The flash loan works as follows: A borrower can request funds from Aave, but they must pay back those funds, and a 0.09% fee, within the same block. If the borrower doesn’t do this, the entire transaction is cancelled, so that no funds were ever borrowed. As a result, Aave doesn’t take a risk and neither does the borrower. A borrower may wish to use a flash loan to take advantage of trading opportunities or maximize profits from other systems built on Ethereum. It’s possible to swap different cryptocurrencies in an automatic way using flash loans to generate trading profits. An example of combining Aave flash loans and MakerDAO is shown in the infographic below.