Skip to main content

Four Week Cadence

The Four Week Cadence contract enforces that renewal target maturities fall on 28-day boundaries measured from the Unix epoch at 00:00:00 UTC. When configured as a user's renewalCadence in the Migration Intent Ratifier, it rejects any renewal whose target maturity is not a clean multiple of 28 days from epoch.

When every fixed-term market in the protocol uses this cadence, renewals concentrate on the same four-weekly maturity dates per cycle, which deepens liquidity at each point instead of fragmenting it across arbitrary timestamps.

Boundary Function

The contract exposes a single function from IRenewalCadence:

nearestBoundary(timestamp) = (timestamp / 28 days) * 28 days

nearestBoundary returns the largest cadence point less than or equal to the given timestamp. The Migration Intent Ratifier uses it in two places.

  • Target maturity validation: During Midnight renewals and Midnight-to-Blue exits, the ratifier calls nearestBoundary(targetMaturity) and reverts if the returned value is not exactly targetMaturity. This guarantees the new maturity lands on a 4-week boundary.
  • Blue-to-Midnight renewal anchor: Blue sources have no maturity, so the ratifier uses nearestBoundary(block.timestamp) as the renewal period start. Rate interpolation and elapsed-time calculations are anchored to the most recent cadence boundary.
Cadence is optional, except for Blue-to-Midnight

If renewalCadence is set to address(0), cadence validation is skipped. For Blue-to-Midnight migrations, a cadence is required and the ratifier reverts if one is not set.