๐ฃMath Paper
This paper describes the initial version (v1) of the model, which is currently deployed exclusively on the Ethereum Mainnet.
Last updated
This paper describes the initial version (v1) of the model, which is currently deployed exclusively on the Ethereum Mainnet.
Last updated
Authors: Francisco Lepone and Gabriel Gruber
July 2022
A model is proposed to complete the credit market on the Ethereum blockchain. It enables users to take loans and make deposits at fixed rates for various terms through the creation of Fixed Rate Pools.
Each Fixed Rate Pool represents a specific term. Interest rates are determined based on the utilization rate of each Fixed Rate Pool.
Additionally, the protocol offers the possibility of borrowing or parking liquidity at a floating rate through the implementation of a money market instrument in a Variable Rate Pool. The funding of the protocol is materialized through time deposits and the existence of a remunerated Smart Pool in charge of providing liquidity where required.
Decentralized Finance (DeFi) based on blockchain technologies aims to create a new financial system by building a network of interconnected distributed apps (dApps) that use open-source and non-custodial protocols. By combining some of these dApps, we can recreate traditional financial instruments and even new ones.
Currently, there is a number of efficient protocols for borrowing and lending, such as Compound, AAVE, and Euler among others. All of them have in common that they work with a short rate as a reference for lending costs. Thus, they involve binding deposits and credits to a cost of variable nature.
This work is an attempt to decentralize the credit market, bringing a missing important piece into the DeFi ecosystem, the "time value of money": That is, to be able to make deposits or take loans at fixed rates for a certain period of time, allowing users to hedge interest rate volatility and to lock costs and revenues.
Some protocols approach this problem using a peer-to-peer (P2P) strategy, where lenders and borrowers are individually matched. This strategy, while being conceptually sound and simple, entails several inefficiencies related to matching both amount and time in each transaction. Protocols like AAVE take a different direction, offering a stable (not fixed) rate if the market conditions remain within a certain threshold. While this property provides greater predictability, it does not eliminate the risk and it only works for borrowers below a certain market utilization rate.
Alternatively, a series of fixed-rate protocols were launched during the year 2021. Some of them, like Yield and Notional, use a token to create a component resembling a "Zero Coupon Bond", while others like Element and Pendle use two tokens to distinguish the principal and the interest rate, much like a "Coupon Stripping" approach, to try to discover the fixed interest rate based on the price of one or more assets with a certain expiration date represented by one or more ERC-20 tokens. Unfortunately, these types of protocols have not managed to capture enough liquidity yet. This might be due to their complexity when implementing them in the Ethereum blockchain.
The protocol is aimed to satisfy the credit market with both variable and fixed interest rates by using two types of pools per asset: Variable Rate Pools and Fixed Rate Pools. Probably one of the biggest challenges of being able to establish an efficient (of considerable volume) fixed-term credit market on the blockchain is being able to match supply and demand simultaneously. In fact, if credit supply for a certain maturity arrives before credit demand, it is impossible to guarantee the supplier any given interest rate without putting at risk the protocol solvency. On the contrary, if credit demand arrives before credit supply, loans cannot materialize. To this respect, the role of the Variable Rate Pool is to immediately satisfy the credit demand for any maturity and stay there until there are enough deposits to match the borrowing. This is possible because any given interest rate is not promised to Variable Rate Pool liquidity contributors in advance.
Users can supply their assets to increase the liquidity of the Variable Rate Pool. There will be a Variable Rate Pool for each of the assets supported by the protocol. The role of the Variable Rate Pool is to provide immediate liquidity to any Fixed Rate Pool as required, ensuring that demand for new loans is satisfied. This is the mechanism Exactly protocol has to match credit supply and demand. When a new deposit is made in a certain Fixed Rate Pool, it replaces the prior contribution of the Variable Rate Pool to such pool. In turn, the Variable Rate Pool retains a small fraction of the interest fees as earnings for having provided liquidity in the first place. That way, the Variable Rate Pool liquidity is continuously reused to match the demand for new loans and afterward released in exchange for a fee, ready to be used again for future loans. The rotation speed of these dynamics plays a key role in the profitability of the Variable Rate Pool. The faster the rotation, the higher the rate at it builds up.
Furthermore, Variable Rate Pool liquidity is also available for variable rate loan funding. All the interest generated by this type of transaction is also to be collected by the Variable Rate Pool.
While the protocol does not guarantee liquidity in the pool, it relies on its interest rate model to incentivize it.
By design, the protocol sets aside a percentage of the Variable Rate Pool deposits as Liquidity Reserves. Liquidity Reserves cannot be borrowed and are only made available to meet withdrawal requests in the Variable Rate Pool.
Users can supply and/or borrow assets to/from various Fixed Rate Pools depending on their time horizon preferences. Each new deposit generates an increase in the liquidity for that specific Fixed Rate Pool, reducing its utilization rate. Conversely, each new borrow takes out liquidity and increases the utilization rate. When there is a new transaction (deposit/borrow) in a Fixed Rate Pool, interest rates are determined based on the state of the system at this moment. Nevertheless, credit demand (borrows) and supply (deposits) rates are calculated using different principles.
Any depositor in a Fixed Rate Pool, can withdraw their assets before maturity, provided there is enough liquidity available in the protocol. Similarly, any debtor can repay their debt in advance and release their collateral.
At any time during the life of a Fixed Rate Pool, any investor can ask for a loan provided they have enough collateral to back up the borrow. The collateral is calculated based on the aggregated amount of assets deposited in the various Variable Rate Pools (marked as collateral) that are not already in use to guarantee previous debts.
Exactly protocol has a specific interest rate demand curve for each Fixed Rate Pool and each asset. Increasing or decreasing the rate incentivizes lenders to provide additional liquidity or borrowers to request more credit, respectively. Thus, this mechanism favors the convergence towards an equilibrium between the supply and demand of credit. Since for each of the assets, there is a certain number of maturities, by observing the interest rate term structure users can also determine what pools are the most interesting to participate in.
In practice, we set
The function was thought in such a way that it naturally divides the utilization domain into three well-differentiated areas (Fig. 1). The first region of normal rates (name it normal-regime) in which the utilization levels are well below total available liquidity. A second region in which interest rates increase at a faster pace (leveraged regime) as utilization levels start to exhaust available resources. And a third region (unreachable regime) where rate levels are even higher, eventually diverging and where it is not possible to take credit.
One of the differences between money market protocols and Exactly's approach to term borrowing/lending is that each user can receive/pay a fixed rate when they transact on our platform. Because of that, the choice of an appropriate utilization rate value becomes so crucial.
In variable rate frameworks, fixing the initial rate based on the state of utilization prior to the transaction is not a big issue because rates will rapidly accommodate the following transaction. Under a fixed rate environment, this approach might promote users to take advantage and capture all the liquidity available at current low rates. On the other hand, using an ex-post utilization to fix interest rates does not solve the problem either, as we would be overcharging costs to users. The appropriate approach to solve the problem is to make investors become indifferent to the decision of getting a loan for the total desired amount or splitting it into successive smaller loans.
To achieve that, the protocol needs to calculate the effective interest rate (2) satisfying this condition, i.e.:
Users can supply their assets to different Fixed Rate Pools depending on their time horizon preferences. Each new deposit generates an increase in the liquidity for that specific Fixed Rate Pool, reducing its utilization rate and the corresponding fixed interest rate for a new loan.
In economics, market clearing is the process by which the supply of whatever is traded is equated to the demand so that there is no leftover supply or demand. In the Exactly Protocol, users who are providing demand and supply of credit have access to the same information in the blockchain so there is no "friction" impending interest rate changes, thus rates will always adjust up or down to ensure market clearing.
To accomplish the market clearing condition supply interest rates are defined by the amount of interest pending payment available for distribution among Fixed Rate Pool depositors and Variable Rate Pool liquidity providers. This condition is dynamic and must hold true at all instants of time. The exact distribution among players will depend on their proportional contribution to the backing of loans.
and the total interest assigned to the new depositor will be
Any depositor can withdraw their assets before maturity, provided there is enough liquidity available in the protocol. Withdrawing assets implies selling the position to the Variable Rate Pool at a price equal to the deposited principal amount plus interests earned at maturity discounted at the borrowing rate prevailing at the time of withdrawal. This is equivalent to asking for a borrow in the Fixed Rate Pool for the resulting amount.
Borrowers can repay their debt before maturity and release their collateral. This implies repurchasing the debt at a price equal to de principal borrowed plus the interest owed at maturity discounted at the prevailing deposit rate at repayment time. This is equivalent to making a deposit in the Fixed Rate Pool for the resulting amount.
The total amount of accrued interest earned by depositors is;
and the total amount of accrued interest earned by the Variable Rate Pool;
Users can also take loans at variable rates similar to what they are accustomed to doing in protocols like Compound or AAVE. Under Exactly's architecture, it can be assumed that variable rate borrows take place in a special pool exclusively fed with Variable Rate Pool resources. In this pool, the only allowed operations are borrows and repayments. We use the same type of interest rate supply function as for Fixed Rate Pools.
In this case, to assure the proper behavior of the protocol, a new definition of utilization rate is needed. First, between any two transactions in the Variable Rate Pool, we define the current utilization rate as
Second, each time there is a new transaction in the Variable Rate Pool, a new utilization rate is calculated according to the following rule:
To keep track of the amount that each given single borrow must repay on exit, we record the number of shares that, upon entrance, this borrow represents to the total mass of variable rate loans.
The growth of variable rate debt is updated by calculating the interests between two consecutive transactions in the Variable Rate Pool:
So the updated debt is
So, given a user collateral portfolio, the average Risk-Adjust Factor can be defined as follows
The solvency condition for any given user is that their risk-adjusted collateral be greater or equal to their risk-adjusted liabilities, i.e.:
which provides the close factor as a function of the under collateralization ratio
A very special thanks to Danilo Neves Cruz and Santiago Sรกnchez รvalos for the many hours of fruitful exchange of ideas we have spent during the exciting development of this task.
Compound (2019), https://compound.finance/docs
AAVE (2020), https://docs.aave.com
Euler (2021), https://www.euler.finance
Yield (2020), https://docs.yieldprotocol.com
Notional (2020), https://docs.notional.finance
Element (2021), https://paper.element.fi
Pendle (2021), https://docs.pendle.finance
Uniswap (2018), https://docs.uniswap.org
Liquity (2020), https://docs.liquity.org
Below is the list of parameters in the model.
This paper is only for general information purposes. It does not constitute investment advice or a recommendation or solicitation to buy or sell any investment instrument and should not be used in the evaluation of the merits of making any investment decision. It should not be relied upon for accounting, legal or tax advice, or investment recommendations. This paper reflects the current personal opinions of the authors and is subject to change without being updated.
The Exactly Protocol Interest Rate Model v2 was successfully approved by governance through EXAIP-08 and has been executed. [EXAIP-08] Interest Rate Model Upgrade (IRM v2)
Furthermore, when there is a slippage in the price of these types of tokens, the interest rate to be discovered is indirectly affected. Consequently, the protocols require their own AMM implementation. This poses additional challenges since these special tokens can't be traded on AMMs such as Uniswap. The constant product invariant formula is not ideal for yield tokens, where time is an additional factor. Our goal is to devise a scheme that removes the mentioned obstacles and contributes to the growth of a complete fixed-income market in the blockchain. The protocol admits borrowing and lending at fixed interest rates for different maturities while still offering variable interest rate alternatives, thus covering the entire DeFi credit market.
Let be the total holdings in the Variable Rate Pool at any time and be the fraction of total holdings used as Liquidity Reserves or non-loanable holdings (). We define the loanable portion of the Variable Rate Pool () as:
Let us consider the Fixed Rate Pool () whose maturity operates in . Loans inside a pool are financed by two types of funding: deposits in the same Fixed Rate Pool (loans, ) and contributions from the Variable Rate Pool (loans, ). The interest rate to be applied to each loan is determined by an interest rate demand function that depends on the utilization rate on that specific Fixed Rate Pool.
We model interest rates as a function of the utilization rate () of each Fixed Rate Pool for every transaction by using a single, continuous and differentiable rational function
This function diverges asymptotically when and it acts as a natural barrier to the credit demand as the level of utilization depletes the protocol liquidity capabilities.
The curve can be easily parametrized and adjusted to changing market conditions. In principle, there will be a demand function for each asset and each maturity. Curve parameters , , and are determined through calibration against relevant market data.
where conceptually represents the utilization level at the boundary between a region of normal interest rates () and a region of leveraged interest rates ().
The utilization rate in each Fixed Rate Pool at any time is defined as
where is the total amount of outstanding borrows at time in the Fixed Rate Pool, is the total amount of deposits, is a moving average of the total supply in the Variable Rate Pool for this asset (see 4.1.3), andFR is a configurable parameter that regulates the fraction of Variable Rate Pool total liquidity that is "naturally assigned" to each pool. In this way, and assuming no deposits are made to the Fixed Rate Pool, once all the "natural liquidity" is already borrowed () the utilization rate equals one (). For practical reasons, we will also choose .
The utilization rate in any Fixed Rate Pool can be higher than unity, but interest rates will then rise at a faster pace beyond this value. The maximum value of allowed utilization in a given Fixed Rate Pool will be . That point is reached when all the Variable Rate Pool liquidity is being borrowed by a single Fixed Rate Pool (under the assumption that ).
This choice enables a more flexible calibration of the curve (the lowest the value of , the steepest the interest rates in the leveraged region).
When at time there is a new request for a loan of size , if confirmed, the system would evolve from a utilization state to a state according to the following rule:
The direct use of the Variable Rate Pool supply quantity () in the definition of utilization rate could expose the protocol to a type of manipulation attack. In fact, attackers can deposit to a market's Variable Rate Pool to lower the pool utilization rate to decrease the interest rate and then borrow at a cheaper rate. After that, the attackers can immediately withdraw from the Variable Rate Pool if there are enough assets available there. Although this potential manipulation does not hurt the protocol's solvency, it constitutes an unfair practice affecting users. To discourage this misbehavior, we introduce an exponential weighted moving average (EMA) of the supply in the utilization rate formula.
The idea underlying the choice of is the following: We want the system to adapt slowly when there is an increase in the supply that carries its value above its moving average (lowering interest rates) but we want the system to adapt faster when there are withdrawals that take the supply below its average value (increasing interest rates). So we set as:
and can be easily calibrated to fit a desired time decay window for each case.
When there is a new deposit () to a Fixed Rate Pool, the system determines the total amount of outstanding borrows backed by the Variable Rate Pool and calculates the interest pending payment. The deposit is used to return an equivalent amount of funds to the Variable Rate Pool and its corresponding interest pending payment is assigned to the new depositor. In fact, a fraction of those interests is retained by the Variable Rate Pool as a fee for its matching services. The new depositor thus gets a fraction of the original interests.
Assuming that at time there is a set of borrows funded by the Variable Rate Pool ( is the time when the loan started). The total pending accruing interest on such borrows () is:
Remember that denotes the maturity of the pool. The number of funds to be returned to the Variable Rate Pool will be
Thus, the annualized fixed interest rate on the deposit () can be calculated as follows
Consider the time elapsed between any two operations in the protocol . Assume there are coexisting Fixed Rate Pools in the period whose starting and maturing dates are and , respectively. Furthermore, assume there are active loans and deposits () in pool .
The total interest amount accumulated by the mass of loans from all the Fixed Rate Pools between and is given by:
where is the total amount of variable rate borrows outstanding at time , and is a numerical parameter.
Here means a new borrow is being made and means a repay (partial or total) of an existing borrow is being made.
Defining and we can update the prevailing variable interest rate at as:
Consider a new borrow and the total amount of outstanding debt . The amount of debt-shares associated to is given by
where is the number of debt-shares corresponding to
When the loan is canceled at a later time , the amount to be repaid will be calculated as:
The total accrued interest earned by the Variable Rate Pool between and due to variable rate loans is given by:
In terms of liquidations, we adopted an approach similar to that of the Euler protocol. Consider a given user . Let's call the total amount of collateral measured in USD they hold as a guarantee for their debts. Assume is composed of different assets.
We associate a Risk-Adjust Factor to each asset in order to assess the lending power of each collateral asset. Thus the risk-adjusted collateral is given by
Similarly, the total amount of debt () and the risk-adjusted debt () can be defined as follows
So, given asset , the maximum amount user can borrow from the asset is:
When an account becomes insolvent () a liquidation process must be triggered.
In order to return the account to solvency as fast as possible and involve the least liquidation possible, we define the close factor () as the fraction of outstanding borrows that must be repaid to return the portfolio to solvency. By design, will be dynamic (i.e. dependent on the degree of insolvency).
Be the safe collateralization ratio that must be applied in a liquidation.
Before liquidation we have . Immediately after liquidation, the condition should be .
In order to achieve that, liquidators repay an amount of debt and also pay an extra amount equal to to the Variable Rate Pool in concept of bad debt compensation. At the same time, they take for themselves a fraction of the collateral. The reduction in debt and collateral after liquidation is as follows
Where is the liquidator commission and accounts for the percentage of extra liquidation that is retained to the Variable Rate Pool as compensation for absorbing bad debt residuals after all the collateral is liquidated. Using the solvency condition
: Fraction of total Variable Rate Pool supply selected as Liquidity Reserve.
: Interest Rate value associated with a utilization rate equal to zero.
: Interest Rate value associated with a utilization rate equal to (generally ).
: Fraction of Variable Rate Pool total liquidity a priori assigned to each Fixed Rate Pool.
: Fraction of Variable Rate Pool total liquidity a priori assigned to Variable Rate Pool.
: Scale factor used to define .
: Weighted factor in the Variable Rate Pool supply EMA.
: Time decay parameter used when supply is above average.
: Time decay parameter used when supply is below average.
: Fraction of term-loan interests retained by the Variable Rate Pool upon leaving the Fixed Rate Pool.
: Close factor, a fraction of debt to be repaid by liquidators.
: Target solvency ratio after liquidation.
: Liquidator incentive.
: Variable Rate Pool compensation for bearing bad debt.