Market Making Policy
The Market Making Policy lets a market maker quote a two-sided rate curve (lend and resell) to the Migration Intent Ratifier.
Use Case
The policy is built for lend-side market making, round-tripping between a variable rate market on Morpho Blue and a fixed-rate market on Midnight:
- Deposit funds into a Morpho Vault allocating to a Morpho Blue market, earning the variable rate.
- Lend fixed by migrating into a Midnight position when a borrower matches with the lend rate offered by the market maker.
- Resell the fixed position back into the variable-rate market when a third party wants to lend (or exit their borrow position) at the maker's exit rate, locking in the spread between entry and exit.
The maker quotes both legs continuously through one curve per market. The buy offer side prices lend to Midnight; the sell side prices exits out lending positions.
The policy enforces that the buy (lend) rate is always above the sell (exit) rate at every maturity, such that every round trip carries a positive spread.
Yield Curve
Users can specify up to 8 points on their curve. For example a curve that starts at a lend rate of 4% for 1 day maturities, 5% for 1 week, 6% for 2 weeks etc.
Each point has three fields:
| Field | Meaning |
|---|---|
ttm | Time to maturity, in seconds (the curve's x-axis) |
sellRate | Exit rate quoted by the maker to exit a fixed rate lend position |
buyRate | Lend rate quoted by the maker to enter a fixed rate position |
The curve enforces that the lend rate is strictly higher than the exit rate at every point.
The curve is managed via two functions:
setCurve(onBehalf, tenorMarketId, points)overwrites the entire curve.clearCurve(onBehalf, tenorMarketId)removes it, after which quotes for that slot revert. This is the per-user kill switch.
Either function can be called by the curve owner directly, or by any address the owner has authorized on Morpho Midnight (the same authorization used for bundlers, no separate ACL).
Example: Three-Point Term Structure
A market maker quoting entries above exits at 7d / 30d / 90d on a Midnight market M:
| Time to maturity | Sell rate (exit) | Buy rate (entry) |
|---|---|---|
| 7 days | ≈ 4% APR | ≈ 5% APR |
| 30 days | ≈ 5% APR | ≈ 6% APR |
| 90 days | ≈ 6% APR | ≈ 7% APR |
The shaded area between the two lines is the spread the maker captures on each round trip. The policy enforces this gap stays positive at every maturity.
All three points are set in a single setCurve call. With this curve in place:
- A lend exit on
Mmaturing in 14 days readssellRateinterpolated between the 7-day and 30-day points. - A lend entry on
Mtargeting a 60-day maturity readsbuyRateinterpolated between the 30-day and 90-day points. - A take further out than 90 days reads the 90-day rate flat.
Pausable Variant
PausableMarketMakingPolicy is a pausable subclass shipped alongside the base policy. When paused, getRate() reverts and blocks every take routed through any user's slot on that policy. The kill switch is global to the deployment, not per user.
- Any designated pauser can call
pause(). - Only the owner can
unpause().