PausableMarketMakingPolicy
Git Source - Generated with forge doc
Inherits: MarketMakingPolicy, PausableBase
Title: PausableMarketMakingPolicy
A MarketMakingPolicy that can be paused for all users of this policy instance.
Pausers (configured by the owner) can halt all getRate quotes across every user; only the owner can unpause.
Curve writes (setCurve and clearCurve) are unaffected by the paused state; only the quote path reverts. Per-user pausing is already available via clearCurve.
Functions
constructor
constructor(address _owner, address morphoMidnight) MarketMakingPolicy(morphoMidnight) PausableBase(_owner);
Parameters
| Name | Type | Description |
|---|---|---|
_owner | address | |
morphoMidnight | address |
getRate
Returns the interest rate for the given renewal context.
Midnight to Midnight renewals are rejected. A buy quotes the target market's buyRate, a sell the source market's sellRate. The ttm is floored at zero so past-maturity markets clamp instead of underflowing.
function getRate(
bytes32 sourceTenorMarketId,
bytes32 targetTenorMarketId,
uint256 renewalPeriodStart,
address user,
address taker,
uint256 sourceMaturity,
uint256 targetMaturity,
bool userIsBuyer
) public view override(MarketMakingPolicy, IInterestRatePolicy) whenNotPaused returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
sourceTenorMarketId | bytes32 | The id of the source side of the renewal (the position being closed). |
targetTenorMarketId | bytes32 | The id of the target side of the renewal (the position being entered). |
renewalPeriodStart | uint256 | The renewal period start timestamp (the policy computes the elapsed time internally). |
user | address | The position owner being renewed (the offer maker in the make-on-behalf flow). |
taker | address | The Midnight.take taker, forwarded from isRatified. |
sourceMaturity | uint256 | The source market maturity (0 for Blue to Midnight migrations). |
targetMaturity | uint256 | The target market maturity (0 for Midnight to Blue exits). |
userIsBuyer | bool | The renewed user's side in the trade, derived from the migration direction. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The interpolated rate per second in WAD at the given elapsed time. |