Skip to main content

Morpho V2 To Morpho V2 Policy

The Morpho V2 To Morpho V2 Policy is a base contract for Morpho V2 to Morpho V2 policies that provides common fee logic and rate determination functionality.

Summary

  • Abstract contract (cannot be deployed standalone), must be extended by a policy contract
  • Specifically designed for Morpho V2 to Morpho V2 rolling
  • Fee charged based on duration between terms
  • Fee calculation: feeAmount = repaidDebt × duration × feeRate
    • Where duration = targetMaturity - sourceMaturity
  • Maximum fee: 100% APR (expressed per second)
  • beforeRoll: Snapshots fee recipient balance
  • afterRoll: Validates fee payment
  • Includes previewFee function for off-chain simulation
  • Requires concrete implementations to define getRate() function for auction rate curves

Linear Rate Policy (extends Morpho V2 To Morpho V2 Policy)

The Linear Rate Policy implements a simple linear auction rate curve with one kink point.

Rate Curve

Linear policy

Parameters

  • kink: Percentage of auction duration where rate reaches maximum (max 100%)
  • Inherited: fee, feeRecipient

Target Rate Policy (extends Morpho V2 To Morpho V2 Policy)

The Target Rate Policy implements a multi-kink auction rate curve.

Rate Curve

Target policy

Parameters

  • kink1: When target rate is reached
  • kink2: When target rate plateau ends
  • kink3: When max rate is reached
  • targetRate: Intermediate rate level (max 100% APR)
  • maxRate: Maximum acceptable rate (max 100% APR)
  • Inherited: fee, feeRecipient