What is DEFI automated borrowing & lending?
Automated DEFI borrowing and lending offer crypto users the two most fundamental banking services, earning interest on crypto deposits or paying interest to borrow crypto at interest, but crucially with the bank removed from the equation.
DEFI - decentralised finance - works on a purely Peer-to-Peer level. Users hold their assets in crypto wallets like MetaMask and interact directly with borrowing and lending protocols which function through Smart Contracts. There is no middleman, no central authority and the user retains custody of their funds.
Smart Contracts simply execute specific actions when criteria are met. For example, when this user deposits funds pay this amount of interest daily until funds are withdrawn.
The ‘decentralised’ element of DEFI comes from the fact that Smart Contracts are hosted on blockchains, like Ethereum, which operates across a distributed network of supporting Nodes with no one in ultimate control.
Decentralisation means DEFI protocols cannot arbitrarily restrict access to funds as can happen with traditional banks, but they are not without risks and disadvantages which are listed below.
DEFI Borrowing & Lending in numbers
At its peak in December 2021, there was over $250bn of total value locked in different DEFI applications, which is explosive growth considering that it didn’t really exist as a concept until 2018.
The bear market conditions of 2022 have seen this TVL number decline by more than 50% to around $75bn with the top two lending protocols as of June 15th 2022 - AAVE and Compound - accounting for almost $7.6bn or 10%. This decline will almost certainly continue as investors become more risk-averse.
The peak TVL numbers might seem impressive, but when compared to the global banking sector, valued at around $5trillion, you get a sense of the future potential for DEFI in general, and the core borrowing and lending functions.
How does DEFI work?
To understand how DEFI borrowing and lending work it helps to summarise how decentralised finance functions. There are five distinct layers:
The Settlement Layer
This is where any transactions and balance changes are recorded. In traditional finance, this would be a bank, but in DEFI the role of the central authority is replaced by a blockchain, such as Ethereum.
In order for transactions to be settled on a blockchain, users must pay fees for their transactions to be added to new blocks of data. Fees will vary depending on how individual chains work and the demand at the time for limited block space.
The Settlement Layer is often described as Layer 1 or L1. It provides security for all layers above.
The Asset Layer
In order for financial transactions to take place, the Settlement Layer must support digital assets. Each blockchain has a native asset, for example, Ethereum’s native token is ETH, but in order to create a wider interoperable ecosystem, Ethereum supports a specific asset standard known as ERC-20 allowing for the creation of assets that function in a similar way.
The Protocol Layer
Blockchains like Ethereum rent out the computing power for protocols which provide the logic for DEFI services. You can think of protocols like the backend in computing terms, the engine that the user doesn’t see.
Protocols are collections of Smart Contracts written to execute the specific logic for borrowing funds or lending funds. Some Protocols also have their tokens used to manage Governance, giving holders a vote on how the Protocol is run.
The function of the tokens is again dictated by Smart Contract and the Governance is managed through a DAO - Decentralised Autonomous Organisation - that handles proposals and voting.
The Settlement Layer is often described as Layer 2 or L2.
The Application Layer
Where the protocol layer is the backend, the application layer is the front end. This is the dApp - digital application - that a user sees online. A dApp will provide an interface (website) for users to connect their wallets in order to execute transactions.
The User/Wallet Layer
As DEFI has no central point of control users don’t create accounts or share personal information as in traditional banking arrangements. Instead, a user simply connects their crypto wallet to the dApp and approves certain actions e.g depositing funds under agreed terms, and paying the Settlement Layer to confirm each transaction.
How DEFI Lending works
In the context of the layered structure of DEFI, a borrowing and lending protocol will consist of a number of Smart Contracts (the Protocol Layer) the function of which are simplified into a dApp/website (Application Layer).
The Protocol will be supported by one or more blockchains (Settlement Layers) charging fees to confirm DEFI transactions in new blocks of data.
The dApp/website will provide a User Interface for the Protocol Layer, listing rates of APY that can be earned by depositing (often termed supplying) different cryptocurrencies into Vaults.
If the user wants to start earning the interest they must simply ensure that they have funds available on the relevant blockchain and then connect their crypto wallet to the dApp approving the necessary permissions and fees. The layout will guide the users through the necessary actions.
As soon as funds have been committed they will start earning interest in that cryptocurrency which can be claimed at any time. In return, the Depositor will receive a token that acts as a receipt for the deposit they have made which is fully redeemable in proportion to the underlying asset as it grows with interest.
Depositing funds to a DEFI lending protocol also earns the user rewards in the Governance Token in proportion to the volume/length of deposits.
The Governance Token can itself be staked with the Protocol to earn a reward in return for providing a backstop against potential losses from hacks or black swan events.
Unless there are specific lock-up conditions the user can withdraw funds at any time just by paying the necessary network fees to the blockchain providing the settlement function.
How DEFI borrowing works
In traditional finance, there are generally two ways to borrow money - secured and unsecured loans. A secured loan requires an asset to be provided as collateral which will be sold if the borrower defaults on the loan. Property is a common form of collateral for secured loans.
Unsecured loans involve no collateral but require the borrower to prove their creditworthiness by supplying information about their financial circumstances.
Given that DEFI requires no personal information and happens at the Peer-to-Peer level with no outside authorities involved, unsecured borrowing is very complicated and beyond the average user (we discuss it below). The dominant form of borrowing from a DEFI protocol is secured via collateral in the form of another crypto.
The level of collateral required will vary depending on market conditions and the specific cryptocurrencies involved but the Loan to Value ratio will generally be around 60-65% and is calculated in fiat. This means that users must over collateralise loans generally borrowing up to 60-65% of the value of the collateral provided.
Given the volatility of cryptocurrency the value of the collateral can change, so that LTV figure will also change. If it falls below a predetermined level the user will get what is known as a Margin Call, a request to add more collateral.
If more collateral isn’t added and the LTV doesn’t recover then the user risks their loan being automatically liquidated with the collateral sold to cover the loan. A liquidation fee/penalty will also be taken from the collateral which will vary depending on the platform.
To take out a DEFI loan the user connects their crypto wallet to the dApp, selecting the required asset to borrow, agreeing to the APY for borrowing and required collateral, and then paying the required transaction and connection fees.
The collateral will itself earn interest (as above) which will be deducted from the interest paid on the loaned amount.
Unsecured DEFI Borrowing
As mentioned above secured or collateralised lending is the main form of borrowing within DEFI because of the difficulty of providing unsecured loans in a decentralised system. Decentralisation removes the layers of trusted intermediaries - like credit agencies - that require you to supply large amounts of personal information to prove your suitability for an unsecured loan.
Credit Delegation
One solution to unsecured DEFI lending is credit delegation; where a user with collateral can delegate it to someone with none.
Aave is one example of a DEFI protocol that offers credit delegation using Open Law, a system for creating legal agreements that work on Ethereum, to craft the necessary agreements.
Given the complexity of credit delegation, it isn’t targeted at retail users which is also true of the other more widely used form of unsecured DEFI borrowing - Flash Loans
Flash Loans
A flash loan is a way to borrow crypto funds from a lending pool without the need for collateral, provided the liquidity is returned within the space of one block confirmation of the settlement layer.
Flash Loans can fund complex chains of instant, programmed trades, looking to exploit arbitrage within the DEFI ecosystem - market inefficiencies across tokens and lending pools.
If the funds are not returned within one block, all the associated actions are reversed as if they never happened. If the funds are returned within the space of one block then the lending pool the funds were borrowed from doesn’t lose out - because the funds are returned and they pocked a fee of 0.09%. Whoever took out the Flash Loan gets to keep whatever value they were able to generate, net of the transaction costs associated with each step in the chain and the fee for the Flash Loan.
Given their complexity, most Flash Loans are written as Smart Contracts by developers with an intimate understanding of how DEFI Protocols work.
This might sound like dark financial arts, but it really is just applying the existing techniques that generate value within TradFi (investment banking and hedge funds), to the new world of DEFI (Decentralised Finance). However, given the decentralised nature of DEFI where code is law, Flash Loans have become a huge area of vulnerability.
What is the point of secured DEFI borrowing?
In traditional finance secured loans generally use an illiquid asset (like a house) - something which isn’t easy to sell quickly - to borrow a liquid asset, like money. In the crypto version of a secured loan, one liquid asset is used to borrow a different liquid asset, so what’s the point?
There are plenty of scenarios in which it makes sense to use crypto A as collateral to borrow crypto B:
- You need short-term cash for a deposit on a new house or car, but don’t want to sell crypto A and lose out on the long-term appreciation
- You want to sell crypto but avoid capital gains tax so borrow a Stablecoin and convert that to fiat which doesn’t count as a taxable disposal
- You want to borrow a Stablecoin in order to yield-farm, or trade, generating returns that you anticipate to be greater than the interest rate on the loan
Examples of DEFI lending providers
AAVE and Compound are two of the biggest DEFI borrowing and lending providers.
AAVE offers borrowing and lending across a number of different blockchains including Ethereum, Avalanche and Polygon. AAVE boasts the largest amount of TVL of any lending provider according to Defillama with roughly $4.9bn in deposited assets and $2bn in loans at the time of writing.
AAVE has its own governance token, of the same name, paid as an additional reward to protocol users, which reached an All-Time High of $667 in May 2021 but has declined over 90% since.
Compound is an Ethereum-specific lending protocol listed as second in terms of TVL behind AAVE with around $2.7bn of deposits and $1bn in loans.
Compound has its own governance token, COMP, paid as an additional reward to protocol users, which reached an All-Time High of $911 in May 2021 but as with AAVE’s token has declined by 90% as overall crypto markets have entered a bear market.
1.139 COMP are distributed to users on a daily basis in proportion to their activity. This will continue until the COMP supply cap is reached or there is a governance vote to change this.
Pros & Cons of DEFI borrowing & lending
Advantages
Cutting out Intermediaries
One of the biggest criticisms of traditional finance is the number of intermediaries that add to the cost of borrowing or lending. By functioning in a Peer-to-Peer form more value can be shared with the user and the DAO that sits behind it. Removing trust also means that your personal data isn’t at risk.
Unlocking Value
Lending and borrowing protocols allow users to unlock the value of the crypto holding without having to sell or trade. The interest represents the market value of holding the asset which can either provide a passive income or a means of leveraging assets without having to sell them.
Given the composability of DEFI, borrowing and lending services represent one lego brick in a growing ecosystem of related opportunities for unlocking value.
Automation
Though there is a great deal of complexity in the DEFI Protocols that provide lending and borrowing services, the user only needs to interact with a simple interface. Automation makes the process of earning interest or borrowing funds relatively simple.
Retaining Custody
DEFI borrowing and lending services are automated by the rules within Smart Contracts which cannot be changed to arbitrarily restrict access to funds as can happen with traditional banks. When interacting with a DEFI lending service you remain in control of your funds.
Transparency
DEFI is open source which means there can be greater accountability for how the Protocol is generating the return on your deposit/collateral.
Disadvantages
Security Risks
The flipside of decentralisation is that there is no one to catch you if you fall, and with DEFI there are plenty of potential risks. The protocols themselves can be hacked or simply fail, Compound became the victim of its own mistake vastly inflating the rewards it paid to users in September 2021.
Most users access lending and borrowing services directly through Hot Wallets like Meta Mask which are online by default and therefore at significant risk from hackers. Unless the necessary personal security precautions are taken there is a real risk of losing stored funds/NFTs or inadvertently connecting with a fake or compromised dApp which can then obtain approval to move funds wherever the scammers want.
Liquidation
Cryptocurrencies remain highly volatile so there is always the risk that collateralised loans can be liquidated by a sudden market crash which can happen so fast that borrowers have no time to react.
Unqualified Risk
The simplicity with which a secured crypto loan can be arranged can lead to excessive risk, especially during periods of positive market sentiment. Users might feel that they can borrow against their funds to give them greater exposure to the market, in essence doubling down. The availability of DEFI lending without any barriers can therefore lead to unqualified risk.
Flash Loan Manipulation
Flash Loans have become like a WMD for DEFI being used to exploit and manipulate Protocol logic in order to extract whatever value they can. Some argue that the code is just doing what is written to do, others argue that Flash Loan attacks are just another form of hacking. Either way, DEFI users risk huge losses.
Rug Pulls
The rapid growth in the DEFI sector has attracted bad actors who build DEFI applications with the sole purpose of attracting users only to disappear with funds overnight - what is known as a Rug Pull.
Rug Pulls are common in DEFI because of the lack of accountability and regulation, along with the willingness of users to take significant risks searching for yield.
Things to consider with DEFI lending & borrowing
DEFI has opened up a whole new world of financial services that are much easier to access, more transparent and give the user greater control. But against these benefits, you have to weigh the risks of transacting in a totally unregulated space with immature technology and business models that aren’t fully stress tested.
So before using DEFI lending or borrowing services here are a few things to consider:
The impact of market volatility
Crypto trades 24/7 and prices are notoriously volatile. By locking up your funds as collateral for a loan you are at the mercy of the markets which can quickly push your collateral below the required LTV ratio and liquidate them.
Smart Contract Audits
When using DEFI you aren’t dealing with people or relying on the reputation of an institution, you are simply interacting with computer code. That code will execute whatever conditions are programmed into it.
To minimise the risk of Smart Contract flaws reputable DEFI protocols will have them independently audited. An audit doesn’t on its own guarantee a Smart Contract won’t be exploited, but it does mitigate some of the risk.
Is the risk justified?
Using DEFI borrowing and lending services is a risk-reward trade-off. Make sure you fully understand the risks and where the rewards seem too good to be true, they probably are.