Maple
  • Welcome to Maple
  • Maple for Lenders
    • Introduction
    • Lending
    • Defaults and Impairments
    • Margin Calls and Liquidations
    • Risk
    • Withdrawal Process
  • syrupUSDC for Lenders
    • Powered by Maple
    • Lending in syrupUSDC and syrupUSDT
    • Commitments
    • Drips Rewards
    • Withdrawals
    • Monthly Updates
    • Pendle Integration
  • SyrupUSDC Rewards Prize Draw Program Summary
  • FAQ
  • Maple for Borrowers
    • Introduction
    • Loan Management
  • Maple for Token Holders
    • Introduction to SYRUP
      • MPL to SYRUP Conversion
      • FAQs
    • SYRUP Tokenomics
      • Staking
      • Staking Smart Contract Details
    • Governance and Voting
    • Drips Rewards
    • Research and Media
      • Podcasts
      • News Articles
      • TV Segments
      • Research Reports
      • Data Dashboards
    • Additional Resources
  • Technical Resources
    • Protocol Overview
      • Background
      • Protocol Actors
      • Smart Contract Architecture
      • Glossary
      • Smart Contract Addresses
      • Fees
      • Composability
      • Proxies and Upgradeability
    • Security
      • Security
      • List of Assumptions
      • External Entry Points
      • Emergency Protocol Pause
      • Protocol Invariants
      • Test Report
    • Loans
      • Loans
      • Fixed Term Loans
      • Open Term Loans
      • Refinancing
      • Impairments
      • Defaults
    • Pools
      • Pools
      • Pool Creation
      • PoolManager
      • PoolDelegateCover
      • Accounting
        • Pool Accounting
        • Pool Exchange Rates
    • Strategies
      • Fixed Term Loan Manager
        • Overview
        • Claims
        • Advance Payment Accounting
        • Accounting Examples
      • Open Term Loan Manager
      • DeFi Strategies
    • Withdrawal Managers
      • WithdrawalManager (Cyclical)
      • WithdrawalManager (Queue)
    • Singletons
      • Globals
      • MapleTreasury
      • Oracles
      • Pool Permission Manager
    • Admin Functions
      • Governor Admin Actions
        • Operational Admin Actions
      • Pool Delegate Admin Actions
      • Timelocks
    • Operations
      • Protocol Deployment
      • Open Term Loan Deployment
      • December 2023 Deployment & Upgrade Procedure
      • Strategies Release Deployment Procedure
    • Interfaces
      • FixedTermLoan
      • FixedTermLoanFactory
      • FixedTermLoanFeeManager
      • FixedTermLoanInitializer
      • FixedTermLoanManager
      • FixedTermLoanManagerFactory
      • FixedTermLoanManagerInitializer
      • FixedTermLoanRefinancer
      • Globals
      • Liquidator
      • LiquidatorFactory
      • LiquidatorInitializer
      • OpenTermLoan
      • OpenTermLoanFactory
      • OpenTermLoanInitializer
      • OpenTermLoanManager
      • OpenTermLoanManagerFactory
      • OpenTermLoanManagerInitializer
      • OpenTermLoanRefinancer
      • Pool
      • PoolDelegateCover
      • PoolDeployer
      • PoolManager
      • PoolManagerFactory
      • PoolManagerInitializer
      • PoolPermissionManager
      • WithdrawalManager (Cyclical)
      • WithdrawalManagerFactory (Cyclical)
      • WithdrawalManagerInitializer (Cyclical)
      • WithdrawalManager (Queue)
      • WithdrawalManagerFactory (Queue)
      • WithdrawalManagerInitializer (Queue)
    • SYRUP Token
      • Architectural Overview
      • Base ERC20 Structure
      • Upgradability
      • Modules
      • Time Locks
      • Recapitalization Module
      • Emergency Module
      • Deployment and Migration Procedure
    • GraphQL API
    • SDK
      • Introduction
      • Installation
      • Protocol Actors
      • Usage Guide
  • Troubleshooting & Support
    • Intercom
  • Maple 1.0
    • Access to deprecated Maple 1.0
  • Legal
    • Borrower MLA
    • KYC
    • Interface Terms of Use
    • Privacy Policy
    • syrupUSDC and syrupUSDT - Risks
    • syrupUSDC and syrupUSDT - Defaults and Impairments
    • syrupUSDC and syrupUSDT - Available Jurisdictions
    • Interface Terms of Use [syrupUSDC and syrupUSDT]
    • Interface Terms of Use [Syrup.fi/convert/ and Syrup.fi/stake/]
    • syrupUSDC and syrupUSDT- Privacy Policy
    • SyrupUSDC Rewards Prize Draw Terms & Conditions
Powered by GitBook
On this page
  • Assets Under Management (AUM)
  • Outstanding Principal
  • Outstanding Interest
  • Introduction
  • Naive Approach
  • Optimized Approach (Aggregated Issuance)
  1. Technical Resources
  2. Strategies
  3. Fixed Term Loan Manager

Overview

PreviousFixed Term Loan ManagerNextClaims

Last updated 7 months ago

Assets Under Management (AUM)

The FixedTermLoanManager interacts with FixedTermLoans on behalf of the PoolManager and represents these Loans' outstanding value with the assetsUnderManagement function. This function returns the outstanding principal of all loans plus the outstanding interest.

assetsUnderManagement=outstandingPrincipal+outstandingInterest\large \begin{align} \nonumber assetsUnderManagement = outstandingPrincipal + outstandingInterest \end{align}assetsUnderManagement=outstandingPrincipal+outstandingInterest​

Outstanding Principal

The outstanding principal component of AUM in the FixedTermLoanManager is represented by the principalOut state variable. This variable is incremented and decremented based on the actions of individual Loans and is equal to the sum of principal balance on all outstanding Loans.

principalOut=∑principalloan\large \begin{align} \nonumber principalOut = \sum{principal_{loan}} \end{align}principalOut=∑principalloan​​

Outstanding Interest

Introduction

Outstanding interest in the FixedTermLoanManager has to represent the current aggregate value of the outstanding interest in all loans in the most accurate and efficient way possible. in FixedTermLoans is represented as fixed amounts owed at a given date. For example, a $1m loan with 12% interest and a 30 day payment interval would be shown as:

interest=1e6×0.12×30365=9863.01\large \begin{align} \nonumber interest = 1e6 \times 0.12 \times \frac{30}{365} = 9863.01 \end{align}interest=1e6×0.12×36530​=9863.01​

This amount of $9863.01$ would be due exactly 30 days from when the loan gets funded.

Naive Approach

Using this information, the current value of interest in the FixedTermLoan at any given time can be represented with the following equation:

interest(t)=interestDue×t−paymentIntervalStartpaymentIntervalLength\large \begin{align} \nonumber interest(t) = interestDue \times \frac{t - paymentIntervalStart}{paymentIntervalLength} \end{align}interest(t)=interestDue×paymentIntervalLengtht−paymentIntervalStart​​

So in an easier example, with a loan that expects $1000 on day 20, the value on day 9 would be:

interest(9)=1000×9−020=450\large \begin{align} \nonumber interest(9) = 1000 \times \frac{9-0}{20} = 450 \end{align}interest(9)=1000×209−0​=450​

Expanding on this concept, the naive calculation of the outstanding interest of all loans would be:

interest(t)=∑(interestDueloan×t−paymentIntervalStartloanpaymentIntervalloan)\large \begin{align} \nonumber interest(t) = \sum \Big(interestDue_{loan} \times \frac{t - paymentIntervalStart_{loan}}{paymentInterval_{loan}}\Big) \end{align}interest(t)=∑(interestDueloan​×paymentIntervalloan​t−paymentIntervalStartloan​​)​

Optimized Approach (Aggregated Issuance)

In a system managing many loans at once, calculating the outstanding interest by summing the values naively is prohibitively expensive. In order to represent this value more efficiently, an alternative approach was taken. By saving the values from Loans during interactions and using them in an aggregate expression, a piecewise linear function can be constructed to represent the value of outstanding interest at any given time. This function consists of four parameters:

  1. issuanceRate: Units of fundsAsset per second being earned as interest for all outstanding loans.

  2. accountedInterest: "Snapshotted" value of outstanding interest saved at each point the function parameters are updated.

  3. domainStart: The timestamp marking beginning of the domain in which the interest accrual expression is valid (called the "issuance domain"). Set to block.timestamp after each update.

  4. domainEnd: The timestamp marking the end of the issuance domain.

The equation for outstanding interest is shown below:

outstandingInterest(t)=accountedInterest+issuanceRate×(t−domainStart)\large \begin{align} \nonumber outstandingInterest(t) = accountedInterest + issuanceRate \times (t - domainStart) \end{align}outstandingInterest(t)=accountedInterest+issuanceRate×(t−domainStart)​

where:

domainStart≤t≤domainEnd\large \begin{align} \nonumber domainStart \le t \le domainEnd \end{align}domainStart≤t≤domainEnd​
Interest