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
  • Overview
  • Example 1: Call before domainEnd
  • Example 2: Call after domainEnd, before Loan 2 Payment Due Date
  • Example 3: Call after domainEnd, before Loan 3 Payment Due Date
  • Example 4: Call after domainEnd, after Loan 3 Payment Due Date
  1. Technical Resources
  2. Strategies
  3. Fixed Term Loan Manager

Advance Payment Accounting

Overview

Whenever any interaction is made with a Fixed Term Loan from the FixedTermLoanManager, _advanceGlobalPaymentAccounting is called. The purpose of this function is to account all Loans' outstanding interest and to represent the current state at the current timestamp.

For all of the below examples, the following abbreviations are used:

  • AIAIAI: accountedInterest

  • IRIRIR: issuanceRate

  • DSDSDS: domainStart

  • DEDEDE: domainEnd

For all of the below examples, $accountedInterest$ starts as the following:

AIpre−AGPA=(IR1×(DE0−DS0))+(IR1+2×(DE1−DS1))\large \begin{align} \nonumber AI_{pre-AGPA} = \Big(IR_1 \times (DE_0 - DS_0)\Big) + \Big(IR_{1+2} \times (DE_1 - DS_1)\Big) \end{align}AIpre−AGPA​=(IR1​×(DE0​−DS0​))+(IR1+2​×(DE1​−DS1​))​

Example 1: Call before domainEnd

In this example, the payment is made before the domainEnd, so no payments are removed from the sorted list.

AIpost−AGPA=AIpre−AGPA+(IR1+2+3×(tpayment−DS2))\large \begin{align} \nonumber AI_{post-AGPA} = AI_{pre-AGPA} + \Big(IR_{1+2+3} \times (t_{payment} - DS_2)\Big) \end{align}AIpost−AGPA​=AIpre−AGPA​+(IR1+2+3​×(tpayment​−DS2​))​

Example 2: Call after domainEnd, before Loan 2 Payment Due Date

In this example, the payment is made after the domainEnd, so Loan 1 is removed from the sorted list and domainEnd is updated.

AIpost−AGPA=AIpre−AGPA+(IR1+2+3×(DE2−DS2))+(IR2+3×(tpayment−DS3))\large \begin{align} \nonumber AI_{post-AGPA} = AI_{pre-AGPA} + \Big(IR_{1+2+3} \times (DE_2 - DS_2)\Big) + \Big(IR_{2+3} \times (t_{payment} - DS_3)\Big) \end{align}AIpost−AGPA​=AIpre−AGPA​+(IR1+2+3​×(DE2​−DS2​))+(IR2+3​×(tpayment​−DS3​))​

Example 3: Call after domainEnd, before Loan 3 Payment Due Date

In this example, the payment is made after the domainEnd and Loan 2's payment due date, so Loans 1 and 2 are removed from the sorted list and domainEnd is updated.

AIpost−AGPA=AIpre−AGPA+(IR1+2+3×(DE2−DS2))+(IR2+3×(DE3−DS3))+(IR3×(tpayment−DS4))\large \begin{align} \nonumber AI_{post-AGPA} = &AI_{pre-AGPA} + \Big(IR_{1+2+3} \times (DE_2 - DS_2)\Big) + \\ &\Big(IR_{2+3} \times (DE_3 - DS_3)\Big) + \Big(IR_{3} \times (t_{payment} - DS_4)\Big) \end{align}AIpost−AGPA​=​AIpre−AGPA​+(IR1+2+3​×(DE2​−DS2​))+(IR2+3​×(DE3​−DS3​))+(IR3​×(tpayment​−DS4​))​​

Example 4: Call after domainEnd, after Loan 3 Payment Due Date

In this example, the payment is made after the domainEnd, Loan 2, and Loan 3's payment due dates, so Loans 1, 2 and 3 are removed from the sorted list and domainEnd is updated.

AIpost−AGPA=AIpre−AGPA+(IR1+2+3×(DE2−DS2))+(IR2+3×(DE3−DS3))+(IR3×(DE4−DS4))+(0×(tpayment−DS5))\begin{align} \nonumber AI_{post-AGPA} = &AI_{pre-AGPA} + \Big(IR_{1+2+3} \times (DE_2 - DS_2)\Big) + \Big(IR_{2+3} \times (DE_3 - DS_3)\Big) + \\ &\Big(IR_{3} \times (DE_4 - DS_4)\Big) + \Big(0 \times (t_{payment} - DS_5)\Big) \end{align}AIpost−AGPA​=​AIpre−AGPA​+(IR1+2+3​×(DE2​−DS2​))+(IR2+3​×(DE3​−DS3​))+(IR3​×(DE4​−DS4​))+(0×(tpayment​−DS5​))​​
PreviousClaimsNextAccounting Examples

Last updated 7 months ago

AGPA 1
AGPA 2
AGPA 3
AGPA 4