export type RoundingDirection = 'Up' | 'Down';
/**
 * Library to manage fixed-point arithmetic.
 * https://github.com/morpho-org/morpho-blue/blob/main/src/libraries/MathLib.sol
 */
export declare namespace MathLib {
    const WAD = 1000000000000000000n;
    const RAY = 1000000000000000000000000000n;
    const MAX_UINT_256: bigint;
    const MAX_UINT_160: bigint;
    const MAX_UINT_128: bigint;
    const MAX_UINT_48: bigint;
    function maxUint(nBits: number): bigint;
    /**
     * Returns the absolute value of a number
     * @param a The number
     */
    function abs(a: bigint): bigint;
    /**
     * Returns the smallest number given as param
     * @param x The first number
     * @param y The second number
     */
    function min(...xs: bigint[]): bigint;
    /**
     * Returns the greatest number given as param
     * @param x The first number
     * @param y The second number
     */
    function max(...xs: bigint[]): bigint;
    /**
     * Returns the subtraction of b from a, floored to zero if negative
     * @param x The first number
     * @param y The second number
     */
    function zeroFloorSub(x: bigint, y: bigint): bigint;
    /**
     * Perform the WAD-based multiplication of 2 numbers, rounded down
     * @param x The first number
     * @param y The second number
     */
    function wMulDown(x: bigint, y: bigint): bigint;
    /**
     * Perform the WAD-based multiplication of 2 numbers, rounded up
     * @param x The first number
     * @param y The second number
     */
    function wMulUp(x: bigint, y: bigint): bigint;
    /**
     * Perform the WAD-based multiplication of 2 numbers with a provided rounding direction
     * @param x The first number
     * @param y The second number
     */
    function wMul(x: bigint, y: bigint, rounding: RoundingDirection): bigint;
    /**
     * Perform the WAD-based division of 2 numbers, rounded down
     * @param x The first number
     * @param y The second number
     */
    function wDivDown(x: bigint, y: bigint): bigint;
    /**
     * Perform the WAD-based multiplication of 2 numbers, rounded up
     * @param x The first number
     * @param y The second number
     */
    function wDivUp(x: bigint, y: bigint): bigint;
    /**
     * Perform the WAD-based multiplication of 2 numbers with a provided rounding direction
     * @param x The first number
     * @param y The second number
     */
    function wDiv(x: bigint, y: bigint, rounding: RoundingDirection): bigint;
    /**
     * Multiply two numbers and divide by a denominator, rounding down the result
     * @param x The first number
     * @param y The second number
     * @param denominator The denominator
     */
    function mulDivDown(x: bigint, y: bigint, denominator: bigint): bigint;
    /**
     * Multiply two numbers and divide by a denominator, rounding up the result
     * @param x The first number
     * @param y The second number
     * @param denominator The denominator
     */
    function mulDivUp(x: bigint, y: bigint, denominator: bigint): bigint;
    function mulDiv(x: bigint, y: bigint, denominator: bigint, rounding: RoundingDirection): bigint;
    /**
     * The sum of the first three non-zero terms of a Taylor expansion of e^(nx) - 1,
     * to approximate a continuously compounded interest rate.
     *
     * @param x The base of the exponent
     * @param n The exponent
     */
    function wTaylorCompounded(x: bigint, n: bigint): bigint;
    /**
     * Converts a WAD-based quantity to a RAY-based quantity.
     * @param x The WAD-based quantity.
     */
    function wToRay(x: bigint): bigint;
    /**
     * Returns the market's utilization rate (scaled by WAD).
     * @param market The market state.
     */
    function getUtilization({ totalSupplyAssets, totalBorrowAssets, }: {
        totalSupplyAssets: bigint;
        totalBorrowAssets: bigint;
    }): bigint;
    /**
     * The market's instantaneous supply-side Annual Percentage Yield (APY) at the given timestamp,
     * if the state remains unchanged (not accrued) (scaled by WAD).
     * @param timestamp The timestamp at which to calculate the supply APY.
     * Must be greater than or equal to `lastUpdate`.
     * Defaults to `Time.timestamp()` (returns the current supply APY).
     */
    function getSupplyApy(borrowApy: bigint, utilization: bigint, fee: bigint): bigint;
    function getBorrowApy(rateAtTarget: bigint | null, utilization: bigint, _timestamp: number | undefined, _lastUpdate: number): bigint;
    /**
     * Lista DAO IRM: computes borrow APY with rate cap/floor clamping.
     *
     * Matches the on-chain InterestRateModel._borrowRate logic:
     * 1. Compute adaptive rate (same as Morpho)
     * 2. Resolve effective cap: rateCap (or DEFAULT_RATE_CAP if 0), floored by minCap
     * 3. Clamp avgRate to [rateFloor, cap]
     * 4. Clamp endRateAtTarget to cap/4
     */
    function getListaBorrowApy(rateAtTarget: bigint | null, utilization: bigint, _timestamp: number | undefined, _lastUpdate: number, rateCap?: bigint, rateFloor?: bigint): bigint;
    function wExp(x: bigint): bigint;
    function _getBorrowRate(startUtilization: bigint, startRateAtTarget: bigint, elapsed: bigint): {
        avgBorrowRate: bigint;
        endBorrowRate: bigint;
        endRateAtTarget: bigint;
    };
}
//# sourceMappingURL=mathLib.d.ts.map