This article was originally written by IPFS Force Zone The concept of FIL+DeFi has been quite popular recently. Let’s talk about what we should pay attention to and find decentralized products that suit us through thinking. On September 22, Filecoin project leader Colin mentioned the idea of DeFil (Filecoin and DeFi integration) at the SpaceRace1 celebration, hoping to use the Ethereum ecosystem to realize Filecoind's DeFi. At present, the most urgent application of the DeFil market is the demand of miners for FIL lending. DeFi+FIL=DeFil, Source: Filecoin official, 2020-09-22 We have previously mentioned centralized lending in the article “The “Lending Wave” Behind Filecoin Mortgage”. This time, let’s talk about decentralized lending. 1) What is decentralized lending? For decentralized lending (mortgage lending), users need to provide some collateral to borrow. As identity verification matures, it may develop into credit lending, which does not require excess collateral. If there is a large market fluctuation and the assets are insufficient to cover the liabilities, there will be a risk of asset liquidation. The design and use of DeFil are: 1. Use smart contracts to ensure that all behaviors (user information, transaction behaviors, etc.) are trustworthy; 2. To promote FIL lending and enhance liquidity. Because Ethereum's decentralized lending products are relatively mature, and the official will combine the Ethereum ecosystem as an expansion, this article will draw on the applications on Ethereum to explore the development path of DeFil. Decentralized lending and borrowing: Dharma Dharma is a decentralized lending project, which requires the one-to-one loan and borrowing amount of both parties to be equal, that is, a counterparty is required. This lending method can be understood as a decentralized lending platform, and then both parties confirm the information and deposit, and then start a lending agreement, and all actions are on the chain. MakerDAO is equivalent to a large capital pool, and the capital pool contains ETH and DAI. Borrowers borrow DAI, a stable currency issued by the MakerDAO platform, by mortgaging ETH. MakerDAO only has lenders but no borrowers. Liquidity Pool Lending: Compound Compound is much more optimized than Dharma. Even though it does not rely on the premise of obtaining interest by binding a counterparty to a transaction, it regards borrowers and lenders as two overall liquidity pools. Borrowing and lending in the liquidity trading pool is a lending and borrowing transaction between the total demand of total lenders and total borrowers. The interest paid by the borrower will be distributed to all lenders according to the proportion of lending and borrowing, so there will be no low liquidity of one-to-one lending. For DeFil, its function is definitely a form of both borrowing and lending, because the borrowed FIL needs to be used as collateral. At the same time, the form of circulation pool will greatly improve the utilization rate of loaned assets and is also suitable for diverse borrowers. Based on the above project analysis, we can draw some key points about decentralized lending: liquidity pool form, over-collateralization, additional collateral assets, transaction price, and interest setting. 1. Liquidity pool form. Because the efficiency of peer-to-peer lending is too low, it is difficult to successfully match transactions, making it difficult to use idle FIL. For example, lender A has 100 FIL to lend, but borrower Z needs 200 FIL, and A and Z cannot reach a lending transaction. At this time, it is necessary to find a lender who can lend 200 FIL for Z. The concept of liquidity pool is to cover all lenders and borrowers pools. The lender pool may include all amounts of A, B, C, D, E, F... For Z's demand for borrowing 200 FIL, it can be met from the lender pool, and the interest income is shared equally. Liquidity pool lending transactions, source: IPFS Force Zone, 2020-12-22 2. Overcollateralization. At this stage, whether it is centralized lending or decentralized lending, other crypto assets are required for collateralization. In DeFi, overcollateralization is more common. Different protocols have different overcollateralization ratios, and the main overcollateralization ratio in the market is 100-150%. For example, if A needs to borrow FIL worth 100 yuan, he may need to collateralize ETH, BTC or other supporting assets worth 150 yuan. 3. Additional pledged assets. All mortgage debt positions have a unified excess collateral ratio requirement. If the collateral falls, the platform needs to replenish collateral or liquidate to maintain the asset security of the borrower. If the collateral ratio is lower than the liquidation rate, it will trigger the liquidation of the mortgage debt position. The platform will directly auction or sell through smart contracts, which is similar to the liquidation mechanism in equity pledge financing. 4. Transaction price. The transaction price includes the lending price and the liquidation price, that is, the pricing problem when operating the lending behavior/liquidation behavior, and there are centralized and decentralized decision-making. The common practice of centralized decision-making is to refer to the prices of some centralized institutions or the voting prices of coin holders. Decentralized decision-making is to make decisions through some parameter settings or oracles. 5. Interest setting. The setting of loan interest is also centralized or decentralized. Some centralized practices have fixed interest rates, but the liquidity is low; some are based on setting some participation as a reference. Among the above five points, the lending price and interest setting are the most critical, because if the operation is not done well, it may cause great losses to the liquidity pool. 4) Analysis of lending prices As DeFi has become popular this year, flash loans have been reported to have suffered multiple attacks, resulting in millions of dollars in losses. We later discovered that the reasons for the multiple attacks were all based on price setting loopholes, so how can we face the price? There are two sources for lending prices: on-chain and off-chain. Off-chain means obtaining existing off-chain price data through market software or exchange price API, which may be weighted and brought to the chain. This method is slow to respond, has a certain lag, and is easily manipulated by price changes of centralized institutions; On-chain means that the calculation is done by querying the decentralized exchange on the chain. This method is currently more mainstream, but it also leads to market manipulation due to the lack of precision of some algorithms. Taking the most classic Uniswap as an example, let’s start with the price calculation, hoping to bring some thoughts: Uniswap quantity product is fixed and value is equal In the A-ETH (A is the loan currency) liquidity pool, X*Y=k (k is a fixed constant). X and Y are the amount of A and ETH in the liquidity pool respectively. This fund is generally provided by the liquidity provider LP, which can be understood as providing these tokens for market lending. Source: Uniswap, 2020-12-22 So how to set the quantity of X and Y? Uniswap sets PriceA *X=Price ETH*Y①. So how to calculate the borrowing price at a certain moment? Quantity before and after the transaction, source: Uniswap and IPFS Force Zone, 2020-12-22 It is known that the number of A tokens purchased is: X'-X, so Y-Y' ETH needs to be paid. Then, substituting ①, we get PriceA/Price ETH= (Y-Y')/ (X'-X), which can be understood as the trading pair of the centralized exchange, and this part is the decentralized trading exchange rate. Because the A-ETH trading pool Price A *X=Price ETH*Y, as more A tokens are purchased, X will become less and less, and the amount of Y in ETH will become more and more, which directly increases the exchange price of A to ETH, that is, the slippage is too large. Some speculators will use the difference between the "slippage" of the A-ETH trading pool and the centralized exchange to arbitrage. Therefore, some decentralized lending in DeFil may refer to some parameters of Uniswap to set prices or interest rates. This behavior may need to be further improved, for example: increase the liquidity pool of DeFil, increase the depth, and avoid the appearance of big players causing too fast slippage; add some centralized reference factors; and later introduce the time-weighted average price in Uniswap V2, rather than the price at a certain moment; such as Banlance added a W asset weight parameter, expanding to a three-dimensional perspective to calculate the price, making the exchange price more stable. 5) Interest rate setting analysis Generally speaking, in decentralized lending rates, interest models are mainly set to meet the supply and demand of the project. There are three main types: linear interest rate, polynomial interest rate and exponential interest rate. Source: 8btc.com, 2020-08-21 The above three interest rate functions will use the utilization rate as a horizontal axis, that is, the proportion of the loan amount to the total capital pool. The three are set up mainly to stimulate the market or achieve smoothness at different stages. Linear interest rates can achieve rapid changes in capital utilization at different stages; polynomial interest rates and index interest rates can achieve a smooth increase in the entire stage, but the degree of increase may be different, and the index interest rate may increase relatively later. 6) Current status of DeFil For DeFil, the main thing to achieve is to incentivize lenders in the market and balance the interest rate relationship between borrowers and lenders. The interest rate parameters at different stages are conducive to promoting the participation of lenders and borrowing of borrowers, and need to be adjusted according to market behavior; at the same time, some merchants will issue new tokens as incentives, but whether they can serve as a long-term stable medium needs to be considered, otherwise it will only be short-lived. The above is only a research reference for DeFil based on the current lending projects on the Ethereum network. At present, the direct implementation of DeFil may require cross-chain implementation, which may take a long time to implement; the indirect implementation is to map assets to ETH and realize the lending function through the underlying protocol on Ethereum. In general, if we use a decentralized FIL lending product, the core is to consider the setting of price and interest rate. The price is mainly to ensure that the FIL price is reasonably evaluated; while the interest rate is to ensure that our income is maximized.
Statement: This article is an original article from IPFS Force District. The copyright belongs to IPFS Force District. It may not be reproduced without authorization. Violators will be held accountable according to law. Tip: Investment is risky, so be cautious when entering the market. This article is not intended as investment and financial advice. |