Skip to main content

Last Friday of Month Cadence

The Last Friday of Month Cadence contract enforces that renewal target maturities fall on the last Friday of each calendar month, at a time of day fixed when the contract is deployed. The instance deployed by Tenor sets this to 15:00:00 UTC, matching the maturity time of Tenor markets. When configured as a user's renewalCadence in the Migration Ratifier, it rejects any renewal whose target maturity does not land exactly on one of these monthly boundaries.

Boundary Function

The contract exposes a single function from IRenewalCadence:

cadencePeriodStart(timestamp) = the boundary at or before timestamp

cadencePeriodStart returns the largest cadence point less than or equal to the given timestamp. Because calendar months differ in length, consecutive boundaries are 28 or 35 days apart. The function reverts for timestamps before the first boundary, January 30, 1970. The Migration Ratifier uses it in two places:

  • Target maturity validation: During Midnight renewals and Midnight-to-Blue exits, the ratifier calls cadencePeriodStart(targetMaturity) and reverts if the returned value is not exactly targetMaturity. This guarantees the new maturity lands on a last-Friday boundary.
  • Blue-to-Midnight renewal anchor: Blue sources have no maturity, so the ratifier uses cadencePeriodStart(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.