import Dec from 'decimal.js'; import { MorphoMidnightBookOffer, MorphoMidnightBookSide, MorphoMidnightParsedBook } from '../../types'; export declare const midnightTimeToMaturityDays: (maturity: number, atSeconds?: number) => number; export declare const midnightApyFromPrice: (price: Dec.Value, ttmDays: Dec.Value) => string; /** * Inverse of `midnightApyFromPrice`: the loan-per-unit price a borrow APY implies, * price = (1 + rate)^(−ttmDays / 365). */ export declare const midnightPriceFromApy: (ratePercent: Dec.Value, ttmDays: Dec.Value) => string; export declare const MIDNIGHT_DEFAULT_RATE_SLIPPAGE = 0.1; /** Which side of the estimate a guard sits on: a ceiling for borrows, a floor for paybacks. */ export type MidnightRateBoundKind = 'ceiling' | 'floor'; export declare const midnightBoundPrice: (estRate: Dec.Value, ttmDays: Dec.Value, kind: MidnightRateBoundKind, boundRate?: Dec.Value, rateSlippagePercent?: Dec.Value) => string; export declare const midnightBookBestFirst: (side: MorphoMidnightBookSide) => 1 | -1; export declare const buildMidnightParsedBook: (offers: MorphoMidnightBookOffer[], side: MorphoMidnightBookSide) => MorphoMidnightParsedBook | null;