[swastir] zou chuanwei: the basic module of DeFi and the framework of risk analysis | cloud map thoughts
Original author: zou chuanwei
This paper extracts the basic module of DeFi and proposes the risk analysis framework of DeFi. DeFi has a rich topology. The main risks involved in DeFi include market risk, credit risk, liquidity risk and technical risk. There are two types of contracts in DeFi, the creditor's rights contract and the equity contract. As a decentralized agreement, DeFi is essentially a combination of debt contract and equity contract. DeFi guides the behavior of the participants through an arbitrage mechanism. Arbitrage mechanisms are also important to understand the flow and pricing mechanisms in DeFi. There are multi-dimensional interconnections between DeFi projects, forming a complex risk transmission mechanism.
Decentralized Finance (hereinafter referred to as DeFi) refers to the open and Decentralized financial agreements within the block chain constructed by intelligent contracts, including lending, transaction, investment and financing. Since 2018, there has been a lot of experimentation and innovation in DeFi and a lot of discussion. However, on March 12 this year, due to the sharp decline in the cryptocurrency market, a large amount of collateral was cleared for several DeFi projects. This shows that the current DeFi field, like the multi-layer nesting of lego blocks, is inherently unstable and needs to be systematically sorted out and optimized from the perspective of financial economics.
This paper attempts to refine the basic Building Block of DeFi, and proposes DeFi's risk analysis framework based on the practice of the mainstream financial field. This paper is divided into seven parts. The first part presents the topology of DeFi and discusses the main types of risks involved in DeFi. The second part discusses the debt contract in DeFi. The third part discusses the equity contract in DeFi. The fourth part discusses the combination of debt contract and equity contract. The fifth part discusses the arbitrage mechanism in DeFi. Part vi discusses the interrelationships between DeFi projects. The seventh part summarizes the full text. This paper also includes two technical attachments: "liquidity cost measurement" and "interest parity relationship between PoS tokens".
1
The topology of DeFi and the main types of risks involved
There are "points" and "lines" in DeFi. "points" refer to the participants of DeFi, and "lines" refer to the connections between these participants.
Participants in the mainstream financial sector include providers and demanders of capital as well as financial institutions and financial markets. In DeFi, these participants are represented as addresses within the blockchain and smart contracts, which also have addresses. Therefore, regardless of the role played by a DeFi participant, it is essentially an address within the blockchain, which is the "point" of DeFi.
Inside the block chain is a trust environment, and the address is essentially anonymous. There is no necessary connection between the address and the identity and credibility mechanism outside the block chain, and it is difficult to penetrate the controller behind the address in general. Therefore, the address within the block chain cannot be used as the credit principal. In mainstream finance, when individuals or businesses apply for loans from Banks, Banks assess their willingness and ability to repay. When a company issues bonds to raise money, investors evaluate its credit rating. When a company raises equity capital, investors evaluate its earnings prospects. However, none of these estimation efforts exist in DeFi. The credit risk management in DeFi is highly dependent on over-collateralization.
The participants of DeFi are connected together through financial contracts, which is the "line" of DeFi, which is mainly divided into creditor's rights contracts and equity contracts. These financial contracts are expressed through programmable scripts within the blockchain (i.e., smart contracts), which are represented as Token transfers between addresses under certain triggering conditions. Therefore, the DeFi activity is ultimately represented as Token transfer. Token transfer has both the meaning of fund circulation and the meaning of risk transfer.
The financial contract between DeFi participants has the following key characteristics:
First, financial contracts affect the financial incentives of DeFi participants.
Second, if the triggering conditions of financial contracts depend on the information outside the blockchain, it needs to be written into the blockchain by the prophet first. The accuracy and timeliness of the predictor is a major source of risk for DeFi.
Thirdly, miners or verification nodes process financial contracts according to rules, while miners or verification nodes themselves are "competing for positions", making financial contracts automatically processed and difficult to be blocked.
Fourth, the DeFi activity takes place in the blockchain, which is subject to the physical performance of the blockchain and the security of the smart contract. This also constitutes a major source of risk for DeFi. It should be noted that although the address within the blockchain cannot be used as a credit entity, the balance sheet of the address can be reorganized by analyzing the DeFi financial contract. Part iv shows that balance sheet analysis is an important DeFi analysis tool.
DeFi mainly involves the following risk types:
1. Market risk refers to the risk of DeFi participants' loss due to adverse changes in Token price. Because of the high volatility of cryptocurrency prices, market risk is very prominent in DeFi.
2. Credit risk refers to the possibility of loss of the creditor in DeFi due to the failure of the repayment address to perform the Token repayment obligation. Credit risk management in DeFi is highly dependent on overcollateralization, but overcollateralization cannot completely eliminate credit risk.
3. Liquidity risk refers to the inability of DeFi participants to obtain sufficient tokens in a timely manner, or to obtain sufficient tokens in a timely manner at a reasonable cost, in response to the risks of asset growth or payment of maturing debts. An important source of liquidity risk in DeFi is that tokens are used as collateral to lock up liquidity.
4. Technical risks mainly come from: 1. Due to the physical properties of blockchain, transactions such as auction on the chain and disposal of collateral on the chain cannot be processed in time; 2. 2. Smart contract loopholes and writing errors, which have been an important problem since The DAO incident; 3. The prediction machine is not accurate, or it is not updated timely due to the physical performance of blockchain. When the market is in turmoil and panic, blockchain is prone to congestion. Some transactions that help clear market risks may not be processed by miners, or they may need to pay a high commission or Gas fee to be processed by miners, which is reflected as settlement risks that cannot be ignored. This will not only reduce the efficiency of market risk clearing and rebalancing, but also reduce the confidence of market participants in the orderly operation of the market, further amplifying market panic.
2
A debt contract in DeFi
Debt contracts are the basis for understanding borrowing, derivatives, and leverage activities in DeFi. Next, consider the most basic debt contract: A Token that transfers X amount from address A to address B at A certain point, and A Token that transfers Y amount from address B to address A after A certain period of time.
In the future, the smart contract has no special requirements for the receiving address A, but A very strong requirement for the repayment address B: if the number of tokens in the repayment address B is lower than Y, the transaction will fail. That's the credit risk. Technology alone cannot guarantee that the number of tokens at the repayment address B exceeds Y. The solution is to set an excess mortgage on the repayment address B.
The mortgage can use the same Token as the debt contract or different Token, as long as the market value of the collateral exceeds the principal and interest of the debt contract. If the Token in the repayment address B is insufficient at A future point in time, the smart contract will protect the interests of the receiving address A by disposing of the collateral.
The use of excess collateral to manage credit risk can be understood from the following perspective:
First, excess mortgages lock up liquidity, which translates the credit risk of debt contracts into liquidity risk. Liquidity is a scarce resource at all times. Collateral for any asset means giving up other, higher-yielding USES. For example, a Token is pledged, giving up the right to sell at a higher price. The more volatile the Token price is, or the longer the mortgage period is, the higher the liquidity cost will be. Liquidity costs are also related to the strategy of holding tokens. For the long-term holder of the Token, because there is no plan to sell the Token, the cost of locking in the Token is low. But for an ordinary investor, locking tokens at a time when their price is volatile can be costly. There is an in-depth discussion on this issue in annex I, liquidity cost measurement.
Second, the value of the debt contract is based on the excess collateral, not the credit of the repayment address B. In fact, there is no way to define or measure the credit of the address in the de-trust environment within the blockchain. This seemingly obvious conclusion has a profound effect on DeFi. In DeFi lending, this results in the fact that the borrowing rate does not include the risk premium for the borrower, making DeFi lending inefficient in resource allocation. But in MakerDAO, it ensures that Dai from different CDP (Collateralized Debt Position) have the same value connotation, so they are mutually equivalent.
Third, if the mortgage USES a different Token from the debt contract, the change in the exchange rate between the two tokens will affect the mortgage rate. Even if the mortgage rate is greater than 1 at the beginning, it is not guaranteed to be greater than 1 at the point of repayment. Therefore, the excess mortgage can not completely eliminate the credit risk, and the credit risk can be transformed from the market risk. Other things being equal, the higher the volatility of the exchange rate between the two tokens, the higher the excess pledge rate required. The logic behind this is the same as a Haircut in mainstream finance.
Fourth, if the physical properties of the block chain prevent the repayment transaction or the disposal of the collateral from being processed in the first place, then the interests of the receiving address A are still not effectively protected. In other words, technical risk can be translated into credit risk. This does not happen in normal times, but it did during the market turmoil of March 12th. The liquidation and collateral supplementation caused by market turmoil have increased the demand for intra-block chain transactions, making the physical performance of the block chain a hard constraint and slowing down the speed of market risk clearing.
Fifth, from the perspective of repayment address B, the excess collateral it provided still belongs to its assets, and it also acquired new assets through borrowing, thus assuming the market risk exposure brought by these two types of assets. Therefore, the debt contract has the leverage effect of magnifying the risk exposure. This seemingly obvious conclusion also has a profound impact on DeFi. Whether it is the MakerDAO stability currency project or the decentralized lending project represented by Compound, the core debt contract has leverage effect. Leverage is naturally pro-cyclical. When markets rise, the same amount of collateral can be used to lend more assets in decentralised lending, or to generate more Dai through MakerDAO, which can boost asset prices. When the market falls, the collateral to the security of the debt contract weakened. When reduced to a certain extent, the collateral is disposed of. Disposing of collateral further depresses its value. This pro-cyclical problem became apparent on March 12.
3
An equity contract in DeFi
Equity is a claim on an asset or future cash flow. In DeFi, there are two main patterns of equity contracts.
First, Token vouchers are issued based on asset reserves, and there is a certain two-way exchange relationship between Token vouchers and assets. This model has four seed models:
A single asset as a reserve. ImBTC, for example, USES this submodel to realize the cross-link of assets from bitcoin blockchain to ethereum blockchain.
A basket of assets as reserves. For example, in Libra 2.0, Libra Coin is used as a basket of stable currencies, combining the relevant single currency stable currencies (e.g., usd 50%, euro 18%, yen 14%, sterling 11% and Singapore dollar 7%) with a fixed nominal weight through smart contracts.
(the above two seed models are based on 100% asset reserve, and the Token certificate does not share the investment income of asset reserve.)
CD submodel. This seed model is also based on 100% asset reserve, but asset reserve can be invested and earn income (for example, Compound or Staking), and the investment income can be Shared with Token certificates. Token certificates can be circulated in the secondary market and cashed in investment income upon redemption. Because the asset reserve investment has a term constraint, if the Token certificate can be redeemed at any time, this seed model involves the conversion of term and liquidity. For example, REX, the EOS resource leasing market, belongs to this seed model.
Bancor submodel. This seed mode can issue Token certificates based on part of the asset reserve, and the exchange rate between Token certificates and assets is adjusted according to Bancor algorithm (figure 1). For example, EOS RAM belongs to this seed mode. What you need to see is that 100 percent of assets can be considered a special case of the Bancor algorithm.

-- figure 1: Bancor algorithm --
Second, Token vouchers represent future cash flows. For example, MKR in MakerDAO belongs to this pattern. On the one hand, all MKR holders have positive cash flow income through the stabilization fee channel. At the time of Dai redemption, the issuer sends Dai and the stabilization fee paid with MKR to the smart contract on the mortgage position. On the other hand, if the MakerDAO system loses money, MKR is issued to absorb the loss by diluting all MKR holders. On March 19, MakerDAO launched MKR auction for the first time, through the new issue of MKR to Dai in the repo market, to repay MakerDAO's losses in the market crash on March 12.
4
A combination of a debt contract and an equity contract
As a decentralized agreement, DeFi is essentially a combination of debt contract and equity contract. Let's focus on the example of MakerDAO and Compound.
(a) MakerDAO
MakerDAO's core goal is to make Dai of different debt contracts mutually equivalent, which is a combination of two types of contracts: Dai of mortgage debt warehouse; The second is the system level equity contract MKR.
The mortgage debt position in MakerDAO can be regarded as an SPV (special purpose entity), which is established by the issuer of Dai (theoretically anyone) based on the mortgage assets (illustrated here by ETH) and in accordance with MakerDAO's rules (figure 2). Dai's issuance and redemption process is:
Issuers create smart mortgage bond position contracts (SPVS).
The issuer sends the mortgage assets to a special smart contract (SPV asset side), and all the issuer's ETH mortgage assets are mixed in.
The issuer receives Dai (SPV liability side) from the smart mortgage position.
When Dai redeys, the issuer sends Dai and the stabilization fee paid with MKR to the smart contract on the mortgage bond, unlocking the mortgage asset, and the returned Dai is withdrawn from circulation.

-- figure 2: mortgage debt positions treated as SPVS
Dai is a debt contract at the level of a mortgage bond position. All mortgage debt positions are subject to uniform excess mortgage rate requirements. If the market value of the collateral falls, the issuer needs to supplement the collateral or return part of the Dai to maintain the collateral rate. If the mortgage rate is lower than the liquidation rate, it will trigger the liquidation of the mortgage debt position, similar to the liquidation mechanism in the equity pledge financing.
If the collateral disposal is insufficient to cover the debt gap, MKR will issue an issue and auction off Dai, essentially with MKR holders as the ultimate loss-bearers. Thus, MKR can be viewed as an equity contract at the MakerDAO level. The above measures ensure that the Dai of different mortgage debt positions are equivalent to each other.
(2) of the Compound
As a decentralized lending project, the Compound is a combination of two types of debt contracts, one between the depositor and the Compound intelligence contract, and the other between the borrower and the Compound intelligence contract. The Compound analysis helps to understand the following questions: first, how to analyze the balance sheet of DeFi project; Second, how to form Token deposit and loan interest rate; Thirdly, what are the essential differences between decentralized lending and commercial bank deposit and loan business?
In the Compound, the depositor can transfer the Token he owns into the Compound intelligent contract (coin deposit), and transfer the Token he saves from the Compound intelligent contract back to his address (coin withdrawal) at a future time. A borrower may use the Token deposited as collateral to borrow money from a Compound. The Token lent by the borrower may be different in quantity and type from the Token deposited by the borrower, provided that the excess pledge rate is met. If the borrower's collateral is insufficient, the Compound will force the liquidation of the collateral.
For depositor, borrower and Compound intelligence contract, the Compound agreement defines four accounting subjects: first, Cash, which refers to the Token amount in the address; Second, Borrow refers to the amount of Compound money borrowed by the borrower. The third is Supply, which refers to the amount of money the depositor deposits into the Compound intelligent contract. The fourth is Equity, which stands for owners' Equity. The accounting identity holds for any Token and any address (whether it is a depositor, a borrower, or a Compound intelligent contract) :
Borrow Cash + = Supply + Equity
Figure 3 shows the effect of various activities in the Compound on the balance sheet of the address. Among the four items in the balance sheet, only Cash corresponds to the number of tokens in the address, while the rest are accounting concepts. Therefore, the flow process of tokens can be seen from the increase and decrease of the Cash item.

- save money

- take money

-- deposit interest --

, borrow money

- and money -

-- interest on borrowed money

-- collateral liquidation --
-- figure 3: an analysis of the Compound's balance sheet
For any Token, the interest rate of deposit and debit set by the Compound protocol is as follows:
U = Borrow / + Borrow (Cash)
BorrowingInterstRate + U * = 10% to 30%
SupplyInterestRate = BorrowingInterestRate * U * (1 - S)
U reflects the demand for borrowing money. The higher the demand for borrowing money, the higher the interest rates on both deposits and borrowings. The Compound interest rate is always set at a level higher than the deposit interest rate to protect the interest rate spread income of the Compound agreement. The Compound design is very exquisite, and the setting of the interest rates of deposit and borrowing is in line with the logic of economics, but it is somewhat AD hoc in the setting of specific formulas.
It makes sense to compare the Compound decentralized lending and commercial bank deposits and loans to understand DeFi.
First, a core function of commercial Banks is to assess the credit status of loan applicants, decide whether to lend, as well as the loan amount and interest rate, and use different strategies to manage credit risk. In decentralized lending, credit risk is managed through overcollateral, and there is no credit evaluation or risk pricing mechanism of interest rate.
Second, when commercial Banks lend to individuals and businesses, the asset side adds a loan and the liability side adds a deposit. Thus, commercial bank lending is accompanied by money creation. When borrowing money, the Token is transferred from the smart contract to the address of the borrower, and the total amount of Token remains unchanged. In other words, token-based deposit and loan activities have no money creation. What you need to see is that MakerDAO creates Dai, the stable currency, through its position in mortgage debt, which is another form of money creation.
Thirdly, commercial Banks have the function of term transformation, which is reflected in the fact that the loan term is longer than the deposit term (" borrowing short and lending long "), and they bear liquidity risks due to the maturity mismatch between assets and liabilities. To this end, commercial Banks are subject to liquidity regulation, and the central bank will provide lender-of-last-resort support to commercial Banks. If a decentralized lending agreement is flexible for both deposits and loans, liquidity risks will be assumed due to maturity mismatch.
For example, if the borrowing period obviously exceeds the deposit period, tokens in the smart contract of decentralized lending protocol may not be sufficient to meet the demand for withdrawing currency.
There are two solutions to the problem of maturity mismatch in decentralized lending. One is to move towards peer-to-peer lending, where deposits and loans match in maturity, as with early ETHLend. But this limits the scale of lending activity, making it costly for savers and borrowers to match. The second is to dynamically manage the term of deposit and loan through algorithms. Due to the impact of liquidity shock on both sides of assets and liabilities, the maturity error in decentralized lending is equipped with many factors that are difficult to be predicted by quantitative models and difficult to be managed by algorithms. Some decentralized lending agreements affect the financial incentives of savers and borrowers by setting the level and trend of interest rate curve, etc., so as to control the maturity mismatch problem, but the effect remains to be seen.
5
Arbitrage mechanism in DeFi
DeFi participants seek to maximize their own interests and will not miss arbitrage opportunities. DeFi intentionally directs the behavior of participants through an arbitrage mechanism. Arbitrage mechanisms are also important to understand the flow and pricing mechanisms in DeFi. Here are some examples of arbitrage mechanisms.
(1) issue Token certificates based on a single asset reserve
The arbitrage mechanism will link the price of Token certificates to the value of the asset. If the price of Token voucher is higher than the asset value, the arbitrageur will generate a new Token voucher with the asset to earn the price difference (price of Token voucher - asset value). In this process, the supply of Token credentials increases, and the price of Token credentials decreases.
On the contrary, if the price of the Token voucher is lower than the asset value, the arbitrageur will redeem the Token voucher and obtain the asset in order to earn the price difference (the price of the asset-token voucher). In this process, the supply of Token credentials decreases, and the price of Token credentials drops. This is the price stability mechanism represented by Libra, a stable currency based on 100% legal currency reserves.
(ii) MakerDAO's collateral clearing mechanism
If the collateral rate of the MakerDAO mortgage bond is lower than the liquidation rate, the collateral liquidation will be triggered. According to the system setting of MakerDAO, the liquidators participating in the auction will keep bidding, with the starting bid of 0 Dai, and the final winner will get a discount of at least 3%, providing an arbitrage opportunity for the liquidators to attract them to participate in the auction.
The collateral clearing mechanism is flawed. The starting price is 0 and Dai implicitly assumes that there are enough liquidators to participate in the auction. During the market crash of cryptocurrency (cryptocurrency) on March 12, the ethereum chain was congested with transactions, and Gas charges rose sharply. Ordinary liquidators had no incentive to participate in the collateral auction, while the clearing robot did not adjust the Gas ceiling in time, so the auction transaction was not confirmed. In the end, the Dai 0 transaction occurred and the MakerDAO system lost $4 million.
(3) the function of Uniswap as a prophet
Uniswap places two certain number of tokens (" liquidity pools ") in the smart contract, and automatically calculates the trading price between the two tokens based on the automatic market maker algorithm. If you don't take into account fees, no matter how much the user trades with the smart contract, you have to guarantee a constant product -- x*y=k, x and y are the number of tokens in the liquidity pool, and k is a constant.
Although Uniswap can implement transactions between the two tokens, it does not create an order book for transaction execution and order matching, and there is no price discovery. When trading with the Uniswap liquidity pool, users refer to prices on the central exchange. The arbitrage mechanism makes the trading price on Uniswap close to the price on the centralized exchange. Thus, Uniswap can write price information on a centralized exchange into the blockchain, a decentralized predictor that does not rely on a voting mechanism. But because of the liquidity pool, the cost of trading through Uniswap and implementing the prophet function is not low. It should also be noted that the larger the liquidity pool, the lower the transaction fees for Uniswap.
(4) formation of Token deposit and loan interest rates
The formation of deposit and loan interest rates is a very important issue in both the mainstream financial field and DeFi field. The formation of Token deposit and loan interest rate is inseparable from the arbitrage mechanism. On the one hand, if different deposit channels are completely equivalent in terms of risks and services, and users can freely switch between different deposit channels, then different deposit channels should offer the same deposit rate. If a deposit channel offers a lower interest rate than the mainstream, users will withdraw money from that channel and deposit it in another channel, which will have to raise interest rates.
On the other hand, if different credit channels are completely equivalent in terms of risks and services, and users can freely switch among different credit channels, then different credit channels should charge the same interest rate. If a lending channel charges a rate higher than the mainstream rate, users will not borrow from that channel, forcing the channel to lower the rate.
Finally, the differences in risks and services between different deposit and loan channels will affect their deposit and loan rates in the form of risk premium. Theoretically speaking, the formation of Token deposit and loan interest rate mainly has two kinds of situations.
First, Token comes with Staking property. For example, PoS type public chain Token. Although Nervos is PoW type public chain, but because there are secondary additional and Nervos DAO, also bring Staking property. At this point, Staking constitutes the lowest risk of money channel. (Token standard rather than coin issuing standard, same below). Even for verification in PoS and chain node failure or to do evil "confiscated" mechanism (Slashing), in the ecological Staking should also belong to the lowest risk deposit currency channel. Staking average yield will become the benchmark of deposit and loan interest rates. If such tokens are used as collateral for decentralized lending, then there should be a dynamic arbitrage balance between the lending rate and the average yield of Staking. If Token is compared to currency, the average yield of Staking is equivalent to the interest rate of Treasury bonds or central bank bills (benchmark interest rate). Other interest rates in the market are equal to the benchmark interest rate plus the risk premium. Annex 1 will make a quantitative analysis of Staking average yield. For the two PoS tokens, there is also a very interesting question: is there an interest parity relationship between them? This is discussed in annex ii.
Second, Token has no Staking property. For example, most PoW - type public - chain tokens. At this point, there is no deposit and loan channel with the lowest risk, but the deposit and loan channels with the best liquidity in the market (probably centralized platforms) will provide the benchmark of Token deposit and loan rates.
At present, the arbitrage mechanism between different channels of deposit and loan is not perfect. For the same Token, the deposit and loan rates of different channels vary greatly.
6
Interrelationships between DeFi projects
There are multi-dimensional Interconnenctedness between DeFi projects, which forms a complex mechanism of risk transmission.
First, related assets and liabilities. For example, Dai is a debt contract in the MakerDAO system, but it is used as a Compound asset for deposit and loan.
Second, the interrelation of information. For example, Uniswap ACTS as a predictor to provide price information to other DeFi projects.
If you consider DeFi projects as "points" and the multi-dimensional connections between DeFi projects as "lines", then this provides another perspective to study the topology of DeFi.
The interrelationships between DeFi projects have pros and cons. On the plus side, the development of DeFi projects by functional modules, which can be assembled to produce a DeFi ecology, is a "point-to-surface" model that helps the development of the DeF domain.
The disadvantages are reflected in the following aspects:
First, the correlation between DeFi projects is also a risk transmission channel from one DeFi project to another.
Second, the more fundamental a project is in the DeFi ecosystem, the more likely it is to be associated with more projects. This creates a "moat" of base status projects, but also amplifies the risks of base status projects, thereby introducing a single point of risk of failure in a decentralized ecology. Some of the basic status projects, such as MakerDAO, are already systemically important in DeFi, as they were on March 12.
Thirdly, DeFi's "from point to surface" mode is prone to lack of overall planning, forming a situation of "overlapping houses", which leads to imperfect risk transfer between DeFi projects (such as multi-layer leverage nesting, similar to the square of CDO in the mainstream financial field) and eventually accumulation of risks.
7
conclusion
This paper extracts the basic module of DeFi and puts forward the risk analysis framework of DeFi. The main conclusions are as follows.
If DeFi's actors are considered "points" and the connections between them as "lines," then DeFi has a rich topology. Regardless of the role played by the DeFi participant, it is essentially an address within the blockchain. Block chain is an environment to trust, address can not be used as the credit subject. The DeFi participants are linked to each other through a debt contract and an equity contract written by a programmable script within the blockchain. The DeFi activity is ultimately represented as Token transfer. Token transfer has both the meaning of fund circulation and the meaning of risk transfer. The main risks involved in DeFi include market risk, credit risk, liquidity risk and technical risk.
Debt contracts are the basis for understanding borrowing, derivatives, and leverage activities in DeFi. Credit risk management in DeFi is highly dependent on overcollateralization. Excess mortgages lock up liquidity. However, if the mortgage USES a Token different from the debt contract, the excess mortgage cannot completely eliminate the credit risk. If the physical properties of the blockchain prevent repayment transactions or collateral disposal from being processed in the first place, technical risks can also be transformed into credit risks. Overcollateralization also eliminates the pricing of credit risk in DeFi. Debt contracts have the leverage effect of amplifying risk exposure, and leverage is naturally pro-cyclical.
In DeFi, there are two main patterns of equity contracts. The first is to issue Token vouchers based on asset reserves, and there is a certain two-way exchange relationship between Token vouchers and assets. Second, Token vouchers represent future cash flows.
As a decentralized agreement, DeFi is essentially a combination of debt contract and equity contract. This paper takes MakerDAO and Compound as examples, and finds that: first, balance sheet analysis is an important DeFi analysis tool; Second, DeFi lending does not have money creation and will bear liquidity risk due to maturity mismatch. However, it is difficult to manage liquidity risk by relying on algorithms alone.
DeFi guides the behavior of the participants through an arbitrage mechanism. Arbitrage mechanisms are also important to understand the flow and pricing mechanisms in DeFi. The formation of Token deposit and loan interest rate is inseparable from the arbitrage mechanism. If Token belongs to PoS type public chain, Staking average yield will become the benchmark of deposit and loan interest rates. If Token is compared to currency and Staking average yield is compared to the interest rate of Treasury bonds or central bank bills (benchmark rate), many terms, products and strategies of traditional money market and foreign exchange market can be migrated to DeFi.
There are multi-dimensional interconnections between DeFi projects, including interrelated assets and liabilities, as well as information interconnections. The assemblability of DeFi is conducive to the development of DeFi ecology "from point to surface", but it is easy to lack the overall planning, and imperfect risk transfer between DeFi projects may accumulate risks. The more fundamental a project in DeFi ecology is, the more "moat" it is, but it may introduce a single point of risk of failure.
The research in this paper shows that the following key points remain unchanged no matter what technology is adopted for financial activities, whether it is legal coin or Token, whether it is centralized or decentralized, and whether it is licensed or open.
First, the basic financial functions remain unchanged. DeFi also has six basic financial functions proposed by Boddie and Merton: payment settlement, financing and equity refinement, providing channels for the transfer of economic resources, risk management, information provision, and solving incentive problems.
Second, the meaning of financial contracts remains unchanged. The basis of DeFi is debt contract and equity contract based on intelligent contract.
Third, the connotation and type of financial risk remain unchanged. In DeFi, although the forms of credit risk, market risk, liquidity risk and technical risk are different from the mainstream financial field, the concepts and analytical methods still apply. Therefore, DeFi is also operating risk, which needs to be carefully managed.
-- annex I --
Liquidity cost measurement
The overcollateralization constitutes the value basis of the debt contract in DeFi. Both head DeFi projects such as MakerDAO and Compound can't be separated from excess mortgage. The core of Uniswap is liquidity pool, and pledge Token is needed to participate in PoS type public chain Staking. Token, whether placed in the liquidity pool as collateral or taking part in Staking, essentially gives up the right to sell the Token freely. Therefore, liquidity cost is an implicit but very important cost in DeFi.
Suppose, at some point in time, investors abandon the liquidity of Token, otherwise they can sell their tokens at any time. Assume that the investor has perfect market timing ability and can sell when the Token price reaches the highest value S_max. Then, the difference between the maximum price S_max and the locked end-of-period Token price S_T reflects the cost borne by investors for giving up Token liquidity (figure 4). This is equivalent to a backdated put option with a floating strike price, with a display expression. Liquidity cost is an increasing function of Token price volatility and lock period length. If the high-volatility Token is locked for a long time, investors will bear a high cost.

-- figure 4: liquidity cost --
Because different people have different Token holding strategies, they have different cognition of Token price volatility. The holding strategy and risk preference of investors can be summarized by the standard currency, which is the asset that investors consider to have no risk. For example, ordinary investors use the dollar as their base currency and treat Token as a risky investment. Firm holders (Hodlers) use Token as their standard currency. Intermediate investors are somewhere in between, and the proportion of tokens in their native currency is between zero and one. Figure 5 shows that the volatility of the same Token varies from investor to investor. The higher the proportion of Token in the investor's currency, the lower the volatility of Token, and the lower the liquidity cost caused to them by the same length of lock-up period.

-- figure 5: standard currency and Token volatility --
There are many application scenarios for liquidity costs, as illustrated by two examples.
First, the determination mechanism of the proportion of Staking in PoS type public chain. In the public PoS chain, nodes participating in Staking need to give up the liquidity of Token in order to get block reward (transaction fee is not considered). Whether the node participates in Staking depends on whether the average rate of return of Staking exceeds the cost of Staking. Staking average yield is equal to Token additional rate divided by Staking ratio. The cost of Staking is the liquidity cost, which depends on the length of Staking time, the fluctuation of Token price and the strategy of node holding Token. From this we can get the equation about the proportion of Staking. An important inference is that nodes that tend to hold tokens for a long time are more motivated to participate in Staking. It should also be noted that the Token additional rate of PoS type public chain is generally determined by the algorithm in advance, while the proportion of Staking is an endogenous variable, which will be adjusted according to the public chain and market conditions. Therefore, the average yield of Staking is a random variable before it is engaged in.
Secondly, the quantitative analysis of credit risk and liquidity risk in DeFi. Consider a simple debt contract: the principal is normalized to 1, the interest rate is 0, the term is T, the mortgage USES different Token from the debt contract, and the initial value is C_0> 1. Because the collateral value fluctuates, the collateral value becomes C_T at maturity. If C_T is greater than or equal to 1, the creditor suffers no loss; If C_T & lt; 1, the creditor's loss is 1 minus C_T. In other words, the credit risk of the creditor is Max (1-c_t, 0), which is essentially a put option. Obviously, the initial overcollateralization does not completely eliminate the credit risk assumed by the creditor. The liquidity cost incurred by the debtor for providing the collateral is C_max-C_T, where C_max represents the maximum value of the collateral before maturity.
Two conclusions can be drawn from this simple analysis:
One is that the higher the volatility of the collateral, the higher the initial mortgage rate C_0 should be for a given level of credit risk borne by the creditor. This is the core logic in DeFi for setting the excess mortgage rate.
Second, given other conditions, the higher the initial mortgage rate C_0, the lower the credit risk borne by the creditor, but the higher the liquidity cost borne by the debtor. This is a trade-off.
-- annex ii --
The interest parity relationship between PoS tokens
Two PoS tokens are considered, which are denoted by subscripts 1 and 2 respectively. The current (i.e., at time 0) legal tender prices are respectively
and
. If investors participate in Staking, the rate of return (Token standard) for a period of time in the future is respectively
and
. In t At the moment, the legal coin price of the two tokens is respectively
and
. Now compare the two strategies of investors.
& have spent
Strategy 1: invest in the first Token at time 0, participate in Staking, and & NBSP; T in
Convert to the second Token at any time.
& have spent
Strategy 2: invest in the second Token at time 0 to participate in Staking.
& have spent
So let's say that the investor has a dollar at time 0, and then calculate that in both strategies, it's at time 0
& have spent T The number of tokens of the second type held at the time.
& have spent
The number of tokens of the first type held at the time of policy 1, 0 is
After taking part in Staking
A. In & have spent t
& have spent Time to convert
A second Token.
& have spent
The number of tokens of the second type held at the time of policy 2, 0 is
After taking part in Staking
A.
& have spent
If the market is efficient, the investment performance of the two strategies should be the same. Formula (1) can be obtained after simple mathematical calculation:
& have spent
& have spent & have spent
& have spent & have spent & have spent
& have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent & have spent

That means at time zero and at time zero
& have spent T At the moment, a first Token is equal to how many second tokens. If the second Token is used as the standard, this is actually the exchange rate of the first Token. while
and
It can be regarded as the interest rate of two tokens. Therefore, formula (1) is in fact no Uncovered Interest Rate Parity formula (Uncovered Interest Rate Parity). (1) it indicates that the Token with a high yield has a tendency of depreciation.
& have spent
Of course, like the rate parity formula for fiat currency, (1) is not strictly true:
& have spent
First, there is "friction" in investors' arbitrage, and it is impossible to "seamlessly switch" between different PoS public chains. Lock Token, election and other important "friction" factors.
& have spent
Second, Token price is also subject to liquidity, inherent risk and other factors. Given the current state of the cryptocurrency market, there is a lot of noise involved in the Token price.
& have spent
Third, as discussed in annex I, the yield of PoS Token Staking depends on the additional Token rate and the proportion of Staking. The arbitrage mechanism will establish the linkage relationship between Token price, Token additional rate and Staking ratio.
& have spent
(1) more important revelation: if the price of PoS Token is compared to the exchange rate and Staking yield is compared to the interest rate of Treasury bonds or central bank bills (benchmark interest rate), then many terms, products and strategies of traditional money market and foreign exchange market can be migrated to DeFi.
Original link:https://mp.weixin.qq.com
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia