Skip to main content

Linear Rate Policy

The Linear Rate Policy implements a simple linear auction rate curve with one kink point. It extends the Morpho V2 To Morpho V2 Policy base contract.

Rate Curve

Linear policy

The rate starts at 0% when the auction begins and increases linearly until it reaches the kink point, where it plateaus at the user's maxRate for the remainder of the auction period.

How It Works

1. Set Policy Parameters

The policy owner (via timelock) can configure:

  • kink: Percentage of auction duration where rate reaches maximum (max 100%)
  • fee: Percentage fee charged based on duration between terms (max 100% APR)
  • feeRecipient: Address that receives fees from rolls

2. Rate Calculation

During a roll, getRate() calculates the auction rate based on elapsed time:

  • Before kink: Rate increases linearly from 0% to maxRate
  • After kink: Rate remains at maxRate until maturity
  • At maturity: Rate equals maxRate

The roller contract compares this rate with the user's maxRate and uses the lower value.

3. Fee Execution

The policy charges fees based on the duration between source and target terms:

  • beforeRoll: Calculates fee, snapshots fee recipient balance, returns borrowedAmount = repaidDebt + feeAmount
  • afterRoll: Validates that the fee recipient received the expected fee amount