What is Midnight?
Understand Midnight fixed-rate lending, market units, offers, early exits, collateral, liquidations, gates, and fees for lenders and borrowers.
Midnight is a noncustodial fixed rate lending protocol. No intermediary holds user assets, and users retain direct ownership of their positions.
Users lend or borrow by buying or selling market units that mature on a fixed date. The unit price determines the implied fixed rate for the remaining term.
Markets
Midnight is built around isolated markets that can be created permissionlessly. Each market's configuration is fixed at creation:
| Parameter | Description |
|---|---|
| Loan token | The asset lent, borrowed, and repaid. |
| Maturity date | When outstanding debt is due. |
| Collateral configurations | From 1 to 128 collateral assets, each with its own token, oracle, liquidation loan-to-value (LLTV), and liquidation cursor. |
| Recovery close factor threshold | A loan-token amount used to relax liquidation limits for small remaining collateral balances. |
| Optional gates | Two contract addresses controlling who may increase credit or debt, and who may liquidate. A zero address means unrestricted access. |
Each market has a unique 32-byte ID derived from its full configuration, including the chain ID and Midnight contract address. Changing any parameter produces a different market ID.
Governance-approved parameters
Each collateral's LLTV and liquidation cursor used at market creation must be values enabled by Morpho governance. Values can be enabled but never disabled.
LLTV
LLTV determines how much of a collateral's oracle value contributes to the borrower's maximum debt. The enabled LLTVs are:
| LLTV | Contract value (scaled by 1e18) |
|---|---|
| 38.5% | 385000000000000000 |
| 62.5% | 625000000000000000 |
| 77% | 770000000000000000 |
| 86% | 860000000000000000 |
| 91.5% | 915000000000000000 |
| 94.5% | 945000000000000000 |
| 96.5% | 965000000000000000 |
| 98% | 980000000000000000 |
| 100% | 1000000000000000000 |
Liquidation cursor
The enabled liquidation cursor is 0.3 (300000000000000000), which controls the maximum liquidation incentive. See liquidation incentive for how these parameters affect positions.
These values are enabled on Ethereum, Base, Tempo, Robinhood, and Arc. Governance can add more values; check isLltvEnabled and isLiquidationCursorEnabled on the relevant Midnight contract for the current status.
Units, credit, and debt
Within a market, positions are tracked with units.
- A borrower has debt units: an obligation to repay one loan token per unit before maturity.
- A lender has credit units: each unit is a claim on one loan token repaid by borrowers.
Midnight contracts don't store a rate. They record trades at a unit price, and the unit price determines the implied fixed rate. For a unit price P > 0, the simple rate over the remaining term is:
r = 1 / P - 1
Rates are quoted as APR
Morpho quotes the annualized rate from the example above as APR: the simple return to maturity, scaled to one year without compounding. With T years left to maturity:
APR = r / T
Since October 9, 2026, the Morpho app and the Midnight endpoints of the Morpho API both use this convention. Before that date they quoted Midnight rates as APY, so rates recorded earlier won't match the ones shown now. The convention only affects how the rate is displayed: offers still settle at their unit price.
Morpho Blue markets and Morpho Vaults still quote their variable rates as APY, which includes compounding. Don't compare the two as if they were the same measure: the same return gives a different APR and APY. For example, a 9% APR over six months is about 9.20% APY.
Fungibility
Every settlement has a buyer and a seller, but it does not create a lasting bilateral loan between them.
After settlement, positions are accounted at the market level. A lender holds credit in the market, not a claim against one specific borrower. A borrower owes debt to the market, not to one specific lender.
Positions created at different times in the same market share its full configuration. Within that market, any credit unit is interchangeable with any other, as is any debt unit.
Early exits
Users can reduce an existing position at any time by taking offers in the opposite direction, since taking an offer first offsets the current position before building the opposite one:
- A lender can sell units to reduce credit.
- A borrower can buy units to reduce debt.
- A borrower can also repay directly: repaying one loan token removes one debt unit.
Buying and selling can continue after maturity, except that debt can no longer be increased. This still allows positions to be unwound, which is useful when liquidations are unprofitable.
Offers
Makers publish offers, specifying the price and size at which they are willing to buy or sell units. Midnight does not broadcast offers itself - they circulate through external channels, and routers help takers find executable offers across them. A taker executes an offer by submitting it to the Midnight contract, which settles atomically against the referenced market - creating, transferring, or burning the corresponding credit and debt units.
More on offers, routing, callbacks, and settlement paths here.
Collateral and liquidations
Each market defines which collateral assets it accepts. A market can accept one collateral asset or several.
Borrowers can supply and withdraw collateral as long as withdrawals do not make the position unhealthy. In multi-collateral markets, a borrower may change their collateral mix over time.
A borrower's collateral determines their maxDebt: the maximum debt the position can support. The position is healthy when its debt is less than or equal to maxDebt.
A position can be liquidated if it becomes unhealthy, or if debt remains unpaid after maturity. In a liquidation, a liquidator repays part or all of the debt and receives collateral according to the market's liquidation rules.
More on liquidation mechanics here.
Gates
Midnight is designed to support flexible access-control policies. Markets may specify up to two optional gate contracts at creation, fixed thereafter, that let each market embed conditions specific to its intended use. Those gates are designed in a noncustodial way and cannot lock or take control of user assets.
More on gates here.
Fees
Midnight has two protocol-level fee systems, both bounded by permanent caps.
The settlement fee applies when an offer is taken and is paid entirely by the taker. It creates a small spread between what the buyer pays and what the seller receives, and varies with time to maturity. The annualized fee remains capped regardless of duration.
The continuous fee accrues over time on outstanding lender credit and is borne by lenders. When a lender opens a credit position, their continuous fee rate is fixed for that credit - later changes to the market rate do not affect it. The continuous fee is capped at 1% annualized.