Skip to main content

Fee Policy

The FeePolicy is a policy contract for Morpho V2 to Morpho V1 rolls that charges a flat percentage fee on rolled amounts.

How It Works

1. Set Fee Parameters

The policy owner (via timelock) can configure:

  • fee: Percentage fee charged on each roll (max 1% of rolled amount)
  • feeRecipient: Address that receives fees from rolls

Fees can be disabled by setting fee to 0 or feeRecipient to the zero address.

2. Roll Execution

When a roll is executed, the policy integrates with the roller contract:

beforeRoll:

  • Calculates fee amount: feeAmount = repaidDebt × fee
  • Snapshots the fee recipient's balance
  • Returns borrowed amount: borrowedAmount = repaidDebt + feeAmount

afterRoll:

  • Validates that the fee recipient received the expected fee amount
  • Reverts if fee payment is insufficient

3. Governance

The policy includes governance controls:

  • Timelock: Fee and fee recipient changes require timelock approval
  • Pause: Guardians can pause the policy to prevent new rolls