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. Technical Resources
  2. Pools
  3. Accounting

Pool Exchange Rates

PreviousPool AccountingNextStrategies

Last updated 6 months ago

Overview

Each Maple Pool has two exchange rates, one for deposits and one for withdrawals which can be seen in convertToAssets, convertToExitAssets, convertToShares and convertToExitShares functions.

The difference is because when withdrawing assets from a pool the protocol takes into account unrealizedLosses () which can be thought of as a paper loss due to a Loan impairment. As a result the withdrawal exchange rate needs to take any unrealizedLosses into account to stop LPs front running any losses, this design makes any losses more equitable across all LPs. The reason that two exchange rates must be maintained in the case of an unrealized loss is that a new LP can take advantage of an impairment being removed by depositing right before the unrealizedLoss is reduced. This reduction results in a significant discrete increase in the exchange rate, which can be exploited by a savvy depositor. For this reason, the deposit exchange rate does not recognize the unrealized loss while the withdrawal rate does.

To highlight the difference first let us look at a deposit specific exchange rate functions convertToShares.

convertToAssets

This exchange rate function helps an LP determine how much of the Pool Asset is required to mint a specific number of shares.

exchangeRate=totalAssetstotalSupply\large \begin{align} \nonumber exchangeRate = \frac{totalAssets}{totalSupply} \end{align}exchangeRate=totalSupplytotalAssets​​

But note that unrealizedLosses is not used here.

convertToExitAssets

This exchange rate function helps an LP determine how much of the Pool Assets an LP can withdraw for a specific number of shares.

exchangeRate=totalAssets−unrealizedLossestotalSupply\large \begin{align} \nonumber exchangeRate = \frac{totalAssets-unrealizedLosses}{totalSupply} \end{align}exchangeRate=totalSupplytotalAssets−unrealizedLosses​​

Example

Below is an example of how the exchange rates work in an impair + default scenario. If one exchange rate was used during this process, a depositor could have deposited at a 0.6 exchange rate and withdrawn at a 0.8 exchange rate soon after. This would be an unfair distribution of funds as that depositor would earn a portion of the proceeds from cover and collateral liquidation as profit, rather than experiencing it as a reduction in loss.

# Pre-Impairment

totalAssets      = 1100
totalSupply      = 1000
unrealizedLosses =    0

Deposit  exchange rate = 1.1
Withdraw exchange rate = 1.1

# Post-Impairment (Pre-Default)

totalAssets      = 1100
totalSupply      = 1000
unrealizedLosses =  500

Deposit  exchange rate = 1.1
Withdraw exchange rate = 0.6

# Post-Default

totalAssets      =  800
totalSupply      = 1000
unrealizedLosses =    0

Deposit  exchange rate = 0.8
Withdraw exchange rate = 0.8
more info here