Skip to main content

Static Rate Policy

The Static Rate Policy defines a fixed rate curve that controls how renewal auction pricing changes over time. It stores up to 8 immutable rate points with linear interpolation between them, giving you precise control over the rate a position renews at through the Migration Intent Ratifier.

For example, a borrower can configure a renewal to start bidding at 3% APR the moment the renewal window opens, ramp up to 6% APR over the next 24 hours, and stay at 6% until a lender matches. The rate curve is flat, then linear, then flat, and the policy interpolates the current rate at every take attempt.

Rate Curve

The rate curve is defined at deployment as an array of (rate, duration) points. Between points, the rate is linearly interpolated. The curve is stored as immutable packed values in bytecode for gas efficiency.

Rate behavior by elapsed time:

  • At or before the first point: Returns the first point's rate.
  • Between two points: Linear interpolation between the two rates.
  • Past the last point: Returns the last point's rate.

Constraints:

  • Maximum 8 rate points.
  • Durations must be strictly increasing.
  • Rates are specified per second in WAD precision.

Rate Calculation

When the ratifier calls getRate, the policy:

  1. Computes elapsed = max(block.timestamp - renewalPeriodStart, 0) from the renewal period start provided by the ratifier.
  2. Finds the segment of the rate curve containing elapsed.
  3. Returns the linearly interpolated rate at that point.

Example Rate Curves

Simple linear ramp (2 points):

  • Point 0: rate = 0, duration = 0s (start at 0%)
  • Point 1: rate = 3.17e8 (1% APR), duration = 86400s (1 day)
  • Result: rate increases linearly from 0% to 1% APR over the first day, then stays at 1%.

Step function with plateau (3 points):

  • Point 0: rate = 1.58e8 (0.5% APR), duration = 0s
  • Point 1: rate = 1.58e8 (0.5% APR), duration = 43200s (12 hours)
  • Point 2: rate = 6.34e8 (2% APR), duration = 86400s (1 day)
  • Result: flat at 0.5% for 12 hours, then ramps to 2% over the next 12 hours.

Pausable Variant

PausableStaticRatePolicy is a pausable subclass shipped alongside the static policy. When paused, getRate() reverts with IsPaused(), which causes any ratifier's rate check to revert and blocks every renewal take that points at this policy. Use it as a per-route circuit breaker: pointing a user's slot at a PausableStaticRatePolicy instance gives a designated pauser the ability to halt renewals for that intent without touching the ratifier itself.

  • Any designated pauser address can call pause().
  • Only the owner can unpause().

Canonical Tenor Policies

In production, Tenor renewals do not use bespoke per-position rate curves. Every renewal route points at one of two canonical, immutable PausableStaticRatePolicy instances deployed by the protocol.

Borrow renewals (ascending, 8h steps)

Used by v2v2Borrow and v1v2Borrow renewals. The rate starts at 0% APR and climbs over 24 hours: the longer a borrow renewal sits unfilled, the more attractive it becomes to a counterparty.

20%15%10%5%0%0h8h16h24hElapsed since renewal window openedRate (APR)0%3%10%20%
ElapsedRate (APR)
00%
8h3%
16h10%
24h20%

Lend renewals (descending, 4h steps)

Used by v2v1Borrow, v1v2Lend, and v2withdrawableLend renewals. The rate starts at 20% APR and falls over 12 hours: the longer a lend renewal sits unfilled, the more attractive it becomes to a counterparty.

20%15%10%5%0%0h4h8h12hElapsed since renewal window openedRate (APR)20%10%3%0%
ElapsedRate (APR)
020%
4h10%
8h3%
12h0%

The rate curves above are immutable once deployed; only the pause state of either policy can be flipped, by its designated pauser. The v2→v1 Lend renewal flow is not in launch scope, so no dedicated policy is deployed for it.