Protocol Math
as of 01/04/2023
This section presents the dynamics of all the fundamental variables at the Money Market.
Most numbers are represented as a mantissa, an unsigned integer scaled by 1 * 10 ^ 18, to perform basic math at a high level of precision.
Cash Dynamics
Borrow Dynamics
The Money Market total borrow dynamics is governed by the following differential equation:
Which can be translated to the following difference equation if we apply the explicit Euler discretization scheme:
Each Money Market tracks the total borrowed amount. However, each Smart Account must track the account’s borrowed amount. In that context, we can also track an Interest Rate Index given by:
In other words, the quotient among indexes define the well known discount factor:
such that:
Finally, notice that the borrows increase or decrease at specific time points depending on loans being taken or repaid. These two scenarios imply that the total borrows present discontinuities at such time points.
Protocol Reserves Dynamics
A fraction of the interest generated by the loans go to the Protocol Reserves. In this context, the Reserves are ruled by the following differential equation:
Interest Rate
Finally, the supply rate is given by:
Exchange Rate
The protocol will implement an interest bearing token in order to distribute the accrue interest from borrowers among lenders (similar to Compound cTokens). The token will have an exchange rate with respect to the Money Market or pool underlying given by the following equation:
Rewards Dynamics
where
Last updated