Moma Interest Rate Mechanics
Moma money market is defined as the interest rate that is uniformly applied to all borrowers. As supply and demand change, the interest rate will be adjusted over time. The history of each interest rate in each money market is recorded by an interest rate index calculated at each change in interest rates, which is generated by the user when casting, redeeming, lending, repaying, or liquidating assets.
1.Market Dynamics
For each transaction, the interest rate index of the asset is updated to compound interest since the previous index. The interest for the period of use is to be valued atr * t, and the interest rate for each block is used for calculation as follow:

Total outstanding market loans are updated to include interest pending since the last index:

A portion of the accumulated interest is retained (reserved) as a reserve, determined by the reserve Factor, ranging from 0 to 1 as follows:

2.Borrower Dynamics
The borrower's balance, including interest to be paid, is a ratio divided by the current index by the index of the user's balance at the last checkpoint.
The balance of each borrower's address in the mToken is stored as an account checkpoint. One account checkpoint is a Solidity tuple <uint256 balance, uint256 interestIndex>. This tuple describes the account balance when the last interest is paid.
Last updated
Was this helpful?