For the complete documentation index, see llms.txt. This page is also available as Markdown.

Exchange Rates

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

The difference is because when withdrawing assets from a pool the protocol takes into account unrealizedLosses (more info here) which can be thought of as a paper loss due to a loan or strategy 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 can result in a significant discrete increase in the exchange rate, which can be exploited by a Lender. For this reason, the deposit exchange rate does not recognize the unrealized loss while the withdrawal rate does.

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}

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}

Example: Loan Impairment

Below is an example of how the exchange rates work when a loan is impaired and the impairment is later removed. If one exchange rate was used during this process, a Lender could have deposited at a 0.6 exchange rate and withdrawn at a 1.1 exchange rate once the impairment was removed. This would be an unfair distribution of funds as that Lender would capture value belonging to the LPs who were in the pool when the loan was impaired.

Example: Strategy Loss

The same mechanism covers positions held through a Strategy Manager. Here the Pool holds 400 of its 1100 totalAssets in an Underlying Strategy and is the only Pool funding it. The strategy records an impairment of the full position, and its Strategy Delegate later recognises the loss, after which the strategy reports zero assets.

Two things differ from the loan case. The Strategy Manager splits the strategy's unrealized loss across every Pool funding it in proportion to their shares, so a Pool holding half the shares would report 200 instead of 400. And a recognised strategy loss is final: totalAssets drops, unrealizedLosses returns to zero, and both rates settle at the lower value for every Lender who stayed.

Last updated

Was this helpful?