{
  "sources": [
    {
      "url": "https://raw.githubusercontent.com/morpho-org/vault-v2/bbeda7b27ae80abcf070e0158cb8a31e87bb2286/src/adapters/midnight/README.md",
      "quote": "The adapter also enforces `maxTtm`, the maximum time to maturity for buys across all markets."
    },
    {
      "url": "https://raw.githubusercontent.com/morpho-org/vault-v2/bbeda7b27ae80abcf070e0158cb8a31e87bb2286/src/adapters/midnight/MidnightAdapter.sol",
      "quote": "/// @dev Tokens with an expensive smallest unit (e.g. WBTC, cbBTC, 2-decimal stablecoins) are not supported: rounding and 0-asset buys can accrue significant interest too early."
    },
    {
      "url": "https://raw.githubusercontent.com/morpho-org/vault-v2/bbeda7b27ae80abcf070e0158cb8a31e87bb2286/src/adapters/midnight/MidnightAdapter.sol",
      "quote": "require((boughtNetCredit - buyerAssets) * WAD >= minNetBuyRate * ttm * buyerAssets, NetBuyRateTooLow());"
    },
    {
      "url": "https://raw.githubusercontent.com/morpho-org/vault-v2/bbeda7b27ae80abcf070e0158cb8a31e87bb2286/src/adapters/midnight/MidnightAdapter.sol",
      "quote": "require(sellerAssets >= soldNetCredit.mulDivUp(WAD, WAD + maxNetSellRate * ttm), NetSellRateTooHigh());"
    },
    {
      "url": "https://raw.githubusercontent.com/morpho-org/vault-v2/bbeda7b27ae80abcf070e0158cb8a31e87bb2286/src/adapters/midnight/ratifiers/MidnightAdapterRateRatifierV1.sol",
      "quote": "uint256 timeToMaturity = UtilsLib.zeroFloorSub(offer.market.maturity, block.timestamp);\n        uint256 offerPrice = TickLib.tickToPrice(offer.tick);\n        if (offer.buy) require(offerPrice <= WAD.mulDivDown(WAD, WAD + rate * timeToMaturity), WorsePrice());\n        else require(offerPrice >= WAD.mulDivUp(WAD, WAD + rate * timeToMaturity), WorsePrice());"
    },
    {
      "url": "https://docs.morpho.org/developers/midnight/concepts/fees/",
      "quote": "The maker is always made whole at their quoted price. The fee is paid entirely by the taker. The protocol keeps the difference."
    },
    {
      "url": "https://docs.morpho.org/developers/midnight/concepts/fees/",
      "quote": "When a lender increases their credit, the continuous fee that position will pay is crystallized at the value in force at that moment."
    },
    {
      "url": "https://docs.morpho.org/developers/contracts/midnight/",
      "quote": "A consistent shared budget assumes the same buy direction, loan token, maxUnits, and maxAssets across offers. The core contract does not enforce these matches."
    },
    {
      "url": "https://docs.morpho.org/developers/contracts/morpho-vaults-v2/",
      "quote": "Allocates `assets` from the vault's idle pool to a specific `adapter`. The allocation is subject to the caps configured for the target market."
    },
    {
      "url": "https://morpho.org/whitepapers/midnight-whitepaper.pdf",
      "quote": "The user rate is naturally implied from the discount at which units are traded:"
    },
    {
      "url": "https://github.com/morpho-org/vault-v2/blob/bbeda7b27ae80abcf070e0158cb8a31e87bb2286/audits/2026-10-12-midnight-adapter-trustsec-draft.pdf",
      "quote": "The adapter’s own offers are not affected: the settlement fee only changes the counterparty’s price, and the adapter sets the continuousFeeCap of its own buy offers."
    },
    {
      "url": "https://github.com/morpho-org/vault-v2/blob/bbeda7b27ae80abcf070e0158cb8a31e87bb2286/audits/2026-10-12-midnight-adapter-cantina-draft.pdf",
      "quote": "Root ratifiers can approve offers naming another ratifier"
    }
  ]
}
