Skip to main content

PausableStaticRatePolicy

Git Source - Generated with forge doc

Inherits: StaticRatePolicy, PausableBase

Title: PausableStaticRatePolicy

A StaticRatePolicy that can be paused.

When paused, getRate reverts with IsPaused and blocks renewals.

Pausing does not stop the auction clock; the rate advances on wall-clock elapsed time, pause windows included.

Functions​

constructor​

constructor(address _owner, uint128[] memory rates, uint128[] memory durations)
StaticRatePolicy(rates, durations)
PausableBase(_owner);

Parameters

NameTypeDescription
_owneraddress
ratesuint128[]
durationsuint128[]

getRate​

Returns the interest rate for the given renewal context.

function getRate(
bytes32 sourceTenorMarketId,
bytes32 targetTenorMarketId,
uint256 renewalPeriodStart,
address user,
address taker,
uint256 sourceMaturity,
uint256 targetMaturity,
bool userIsBuyer
) public view override(StaticRatePolicy, IInterestRatePolicy) whenNotPaused returns (uint256);

Parameters

NameTypeDescription
sourceTenorMarketIdbytes32The id of the source side of the renewal (the position being closed).
targetTenorMarketIdbytes32The id of the target side of the renewal (the position being entered).
renewalPeriodStartuint256The renewal period start timestamp (the policy computes the elapsed time internally).
useraddressThe position owner being renewed (the offer maker in the make-on-behalf flow).
takeraddressThe Midnight.take taker, forwarded from isRatified.
sourceMaturityuint256The source market maturity (0 for Blue to Midnight migrations).
targetMaturityuint256The target market maturity (0 for Midnight to Blue exits).
userIsBuyerboolThe renewed user's side in the trade, derived from the migration direction.

Returns

NameTypeDescription
<none>uint256The interpolated rate per second in WAD at the given elapsed time.