IMarketMakingPolicy
Git Source - Generated with forge doc
Inherits: IInterestRatePolicy
Title: IMarketMakingPolicy
Interface of the market making policy where users quote per-market yield curves.
Functions
MORPHO_MIDNIGHT
The Morpho Midnight protocol used for authorization checks.
function MORPHO_MIDNIGHT() external view returns (IMidnight);
curves
Returns the i-th point of the curve of user on tenorMarketId.
function curves(address user, bytes32 tenorMarketId, uint256 i)
external
view
returns (uint32 ttm, uint112 sellRate, uint112 buyRate);
setCurve
Overwrites the curve of onBehalf for tenorMarketId.
Enforces 1 to MAX_POINTS points, strictly increasing ttm, and sellRate <= buyRate at every point.
function setCurve(address onBehalf, bytes32 tenorMarketId, CurvePoint[] calldata points) external;
clearCurve
Deletes the curve of onBehalf for tenorMarketId.
function clearCurve(address onBehalf, bytes32 tenorMarketId) external;
Events
CurveSet
event CurveSet(address indexed user, bytes32 indexed tenorMarketId, CurvePoint[] points);
CurveCleared
event CurveCleared(address indexed user, bytes32 indexed tenorMarketId);
Errors
EmptyCurve
error EmptyCurve();
TooManyPoints
error TooManyPoints();
NonStrictlyIncreasingTtm
error NonStrictlyIncreasingTtm();
CrossedCurve
error CrossedCurve();
NoCurveForUserMarket
error NoCurveForUserMarket();
Unauthorized
error Unauthorized();
UnsupportedMigrationRoute
error UnsupportedMigrationRoute();
Structs
CurvePoint
One point on a yield curve.
struct CurvePoint {
uint32 ttm;
uint112 sellRate;
uint112 buyRate;
}
Properties
| Name | Type | Description |
|---|---|---|
ttm | uint32 | The time to maturity in seconds, the curve's x-axis. |
sellRate | uint112 | Per-second rate in WAD quoted by the lender to sell credit on Midnight (exit a position). |
buyRate | uint112 | Per-second rate in WAD quoted by the lender to buy credit on Midnight (enter a position). |