import { GenericCurrency } from '../general';
import type { FixedTermInfo } from '../lenderTypes';
export type GetMarketsResponse = {
    markets: {
        items: {
            uniqueKey: string;
            irmAddress: string;
            oracleAddress: string;
            lltv: string;
            whitelisted: boolean;
            loanAsset: {
                address: string;
                name: string;
                symbol: string;
                decimals: number;
                priceUsd: string;
            };
            collateralAsset: {
                address: string;
                name: string;
                symbol: string;
                decimals: number;
                priceUsd: string;
            };
            state: {
                borrowApy: string;
                supplyApy: string;
                price: string;
                rewards: {
                    asset: {
                        address: string;
                    };
                    supplyApr: number;
                    borrowApr: number;
                }[];
                borrowAssets: string;
                borrowAssetsUsd: string;
                supplyAssets: string;
                supplyAssetsUsd: string;
                collateralAssets: string;
                collateralAssetsUsd: string;
                fee: string;
                rateAtTarget: string;
            };
        }[];
    };
};
export interface BaseYields {
    variableBorrowRate: number;
    stableBorrowRate: number;
    depositRate: number;
}
export type RewardsMap = {
    [rewardId: string]: BaseYields;
};
export interface RewardEntry extends BaseYields {
    asset: string;
}
export type RewardsList = RewardEntry[];
/**
 * One aggregated level of an order-book side, provider-agnostic (rate + size).
 * Emitted best-first (best executable offer first). Used by fixed-rate
 * order-book lenders (Morpho Midnight, Term Finance) to carry a bounded slice of
 * the live book so consumers can filter later (rate-at-size, dust removal, …).
 */
export interface PublicBookLevel {
    /** annualised rate at this level, PERCENT. */
    apr: number;
    /** aggregate size at this level, loan-token base units (raw string). */
    units: string;
    /** aggregate size at this level, loan-token assets (human number). */
    assets: number;
}
/**
 * Bounded top-of-book slice (best-first, capped per side). `bids` = the BORROW
 * side (take to borrow), `asks` = the LEND side (take to lend). Either side may
 * be empty (e.g. a one-sided secondary market). Present only on order-book
 * fixed-rate markets.
 */
export interface MarketBook {
    bids: PublicBookLevel[];
    asks: PublicBookLevel[];
}
export interface MorphoMarket {
    /** the 1delta lender enum */
    lender: string;
    collateralDecimals?: number;
    loanDecimals?: number;
    /** the market hash */
    id: string;
    /** market params */
    lltv: string;
    oracle: string;
    irm: string;
    collateralAddress: string;
    loanAddress: string;
    /** Lista extensions */
    minLoan?: string;
    broker?: string;
    loanProvider?: string;
    collateralProvider?: string;
    hasWhitelist?: boolean;
    /** false when the market has been removed from the Morpho whitelist */
    isListed?: boolean;
    /** protocol fee */
    fee?: string;
    /** IRM rate at target utilization */
    rateAtTarget?: string;
    /** IRM rate cap */
    rateCap?: string;
    /** IRM rate floor */
    rateFloor?: string;
    /** Fixed-term rate menu — available term products (Lista brokered markets,
     *  Term/Midnight single-maturity markets, Exactly multi-maturity markets —
     *  for Exactly `termId` = the pool's unix maturity timestamp). */
    terms?: {
        termId: number;
        durationSecs: number;
        durationDays: number;
        /** annualised borrow rate in PERCENT (e.g. 3.857 = 3.857% APR) */
        apr: number;
        /** annualised fixed LEND rate in PERCENT at this maturity (Exactly only) */
        depositApr?: number;
        /** borrowable liquidity at this maturity, loan-token human units (Exactly only) */
        available?: number;
    }[];
    /**
     * Canonical cross-protocol fixed-term descriptor (Lista brokered + Morpho
     * Midnight). Present on fixed-rate/fixed-maturity markets only. See
     * {@link FixedTermInfo}.
     */
    fixedTerm?: FixedTermInfo;
    /**
     * Bounded top-of-book slice (best-first, capped per side) for order-book
     * fixed-rate markets (Midnight, Term). Baseline for downstream filtering; the
     * aggregate best rate + full depth stay on the `data[*]` entries. Absent on
     * non-order-book markets.
     */
    book?: MarketBook;
}
export interface MorphoGeneralPublicResponse {
    data: {
        [tokenSymbol: string]: {
            marketUid: string;
            name?: string;
            poolId: string;
            underlying: string;
            asset: GenericCurrency;
            totalDeposits: number;
            totalDebtStable: 0;
            totalDebt: number;
            totalLiquidity: number;
            borrowLiquidity: number;
            totalLiquidityUSD: number;
            borrowLiquidityUSD: number;
            totalDepositsUSD: number;
            totalDebtStableUSD: 0;
            totalDebtUSD: number;
            /** Borrow utilization (0..1). */
            utilization: number;
            depositRate: number;
            variableBorrowRate: number;
            intrinsicYield: number;
            /** fixed-term (broker) borrow rate in percent; 0 for non-brokered Morpho-type markets */
            stableBorrowRate: number;
            /**
             * How the ongoing borrow rate (`variableBorrowRate`) is set, so integrators
             * can label/treat it correctly instead of assuming a pool APR. Absent ⇒
             * `'variable'` (the pool-lender default).
             *  - `'variable'`  — utilization-curve pool rate (Aave, Compound, Morpho…).
             *  - `'userSet'`   — borrower picks the per-position rate (Liquity family).
             *  - `'fixedTerm'` — fixed rate per maturity (Midnight, Term, Exactly, Lista);
             *                    see `params.market.fixedTerm` / `terms`.
             *  - `'zeroInterest'` — NO ongoing rate at all (River/Satoshi). The borrow
             *                    cost is the one-off `originationFee`, not an APR.
             */
            rateModel?: 'variable' | 'userSet' | 'fixedTerm' | 'zeroInterest';
            /**
             * One-off fee charged ONCE at borrow time, as a PERCENT of the amount
             * borrowed (e.g. `0.5` = 0.5%). Front-loaded cost that is NOT an APR and
             * must never be added into `variableBorrowRate`: River mint fee, Liquity
             * upfront fee. Absent / `0` ⇒ no origination fee. For an open position it
             * is already realized into the debt; annualize it over the holding period
             * only for an effective-cost-since-open view.
             */
            originationFee?: number;
            rewards?: RewardsList;
            decimals: number;
            config: {
                [0]: {
                    category: number;
                    borrowCollateralFactor: number;
                    collateralFactor: number;
                    borrowFactor: 1;
                    liquidationPenalty: number;
                    closeFactor: number;
                    collateralDisabled: boolean;
                    debtDisabled: boolean;
                };
            };
            closeFactor: number;
            collateralActive: boolean;
            borrowingEnabled: boolean;
            depositsEnabled: boolean;
            hasStable: boolean;
            /** Lista fixed-term broker markets: variable (flexible) borrowing is not available — borrow
             *  is fixed-term only (via the broker). Supply yield stays variable. False/absent otherwise. */
            variableBorrowDisabled?: boolean;
            isActive: true;
            isFrozen: false;
        };
    };
    /** morpho market info */
    params: {
        market: MorphoMarket;
    };
    chainId: string;
}
//# sourceMappingURL=morpho-types.d.ts.map