import { EthAddress, IncentiveData, LeverageType, MMUsedAssets, NetworkNumber } from './common'; export declare enum MorphoMidnightVersions { MorphoMidnightCbBTCUSDC_860_20260731_Base = "morphomidnightcbbtcusdc_860_20260731_base", MorphoMidnightCbBTCUSDC_860_20260828_Base = "morphomidnightcbbtcusdc_860_20260828_base", MorphoMidnightCbBTCUSDC_860_20260925_Base = "morphomidnightcbbtcusdc_860_20260925_base", MorphoMidnightCbBTCUSDC_860_20261030_Base = "morphomidnightcbbtcusdc_860_20261030_base", MorphoMidnightCbBTCUSDC_860_20261127_Base = "morphomidnightcbbtcusdc_860_20261127_base", MorphoMidnightCbBTCUSDC_860_20261225_Base = "morphomidnightcbbtcusdc_860_20261225_base", MorphoMidnightCbBTCUSDC_860_20270129_Base = "morphomidnightcbbtcusdc_860_20270129_base", MorphoMidnightTenorCbBTCUSDC_20260827_Base = "morphomidnighttenorcbbtcusdc_20260827_base", MorphoMidnightTenorCbBTCUSDC_20260924_Base = "morphomidnighttenorcbbtcusdc_20260924_base", MorphoMidnightTenorCbBTCUSDC_20261022_Base = "morphomidnighttenorcbbtcusdc_20261022_base", MorphoMidnightTenorCbBTCUSDC_20261119_Base = "morphomidnighttenorcbbtcusdc_20261119_base", MorphoMidnightTenorCbBTCUSDC_20261217_Base = "morphomidnighttenorcbbtcusdc_20261217_base", MorphoMidnightTenorWETHUSDC_20260827_Base = "morphomidnighttenorwethusdc_20260827_base", MorphoMidnightTenorWETHUSDC_20260924_Base = "morphomidnighttenorwethusdc_20260924_base", MorphoMidnightTenorWETHUSDC_20261022_Base = "morphomidnighttenorwethusdc_20261022_base", MorphoMidnightTenorWETHUSDC_20261119_Base = "morphomidnighttenorwethusdc_20261119_base", MorphoMidnightTenorWETHUSDC_20261217_Base = "morphomidnighttenorwethusdc_20261217_base", MorphoMidnightTenorWETHUSDC_20260925_Base = "morphomidnighttenorwethusdc_20260925_base", MorphoMidnightTenorWETHUSDC_20261030_Base = "morphomidnighttenorwethusdc_20261030_base", MorphoMidnightTenorWETHUSDC_20261127_Base = "morphomidnighttenorwethusdc_20261127_base", MorphoMidnightTenorWETHUSDC_20261225_Base = "morphomidnighttenorwethusdc_20261225_base", MorphoMidnightTenorWETHUSDC_20270129_Base = "morphomidnighttenorwethusdc_20270129_base", MorphoMidnightTenorCbETHWETH_20260827_Base = "morphomidnighttenorcbethweth_20260827_base", MorphoMidnightTenorCbETHWETH_20260924_Base = "morphomidnighttenorcbethweth_20260924_base", MorphoMidnightTenorCbETHWETH_20261022_Base = "morphomidnighttenorcbethweth_20261022_base", MorphoMidnightTenorCbETHWETH_20261119_Base = "morphomidnighttenorcbethweth_20261119_base", MorphoMidnightTenorCbETHWETH_20261217_Base = "morphomidnighttenorcbethweth_20261217_base", MorphoMidnightTenorCbETHWETH_20260925_Base = "morphomidnighttenorcbethweth_20260925_base", MorphoMidnightTenorCbETHWETH_20261030_Base = "morphomidnighttenorcbethweth_20261030_base", MorphoMidnightTenorCbETHWETH_20261127_Base = "morphomidnighttenorcbethweth_20261127_base", MorphoMidnightTenorCbETHWETH_20261225_Base = "morphomidnighttenorcbethweth_20261225_base", MorphoMidnightTenorCbETHWETH_20270129_Base = "morphomidnighttenorcbethweth_20270129_base", MorphoMidnightWBTCUSDC_860_20260925_Eth = "morphomidnightwbtcusdc_860_20260925_eth", MorphoMidnightWBTCUSDC_860_20261030_Eth = "morphomidnightwbtcusdc_860_20261030_eth", MorphoMidnightWBTCUSDC_860_20261127_Eth = "morphomidnightwbtcusdc_860_20261127_eth", MorphoMidnightWBTCUSDC_860_20261225_Eth = "morphomidnightwbtcusdc_860_20261225_eth", MorphoMidnightWBTCUSDC_860_20270129_Eth = "morphomidnightwbtcusdc_860_20270129_eth", MorphoMidnightWBTCUSDC_860_20270226_Eth = "morphomidnightwbtcusdc_860_20270226_eth", MorphoMidnightWBTCUSDC_860_20270326_Eth = "morphomidnightwbtcusdc_860_20270326_eth", MorphoMidnightCbBTCUSDC_860_20260925_Eth = "morphomidnightcbbtcusdc_860_20260925_eth", MorphoMidnightCbBTCUSDC_860_20261030_Eth = "morphomidnightcbbtcusdc_860_20261030_eth", MorphoMidnightCbBTCUSDC_860_20261127_Eth = "morphomidnightcbbtcusdc_860_20261127_eth", MorphoMidnightCbBTCUSDC_860_20261225_Eth = "morphomidnightcbbtcusdc_860_20261225_eth", MorphoMidnightCbBTCUSDC_860_20270129_Eth = "morphomidnightcbbtcusdc_860_20270129_eth", MorphoMidnightCbBTCUSDC_860_20270226_Eth = "morphomidnightcbbtcusdc_860_20270226_eth", MorphoMidnightCbBTCUSDC_860_20270326_Eth = "morphomidnightcbbtcusdc_860_20270326_eth", MorphoMidnightTenorReUSDUSDC_20260925_Eth = "morphomidnighttenorreusdusdc_20260925_eth", MorphoMidnightTenorReUSDUSDC_20261030_Eth = "morphomidnighttenorreusdusdc_20261030_eth", MorphoMidnightTenorReUSDUSDC_20261127_Eth = "morphomidnighttenorreusdusdc_20261127_eth", MorphoMidnightTenorReUSDUSDC_20261225_Eth = "morphomidnighttenorreusdusdc_20261225_eth", MorphoMidnightTenorSiUSDUSDC_20260925_Eth = "morphomidnighttenorsiusdusdc_20260925_eth", MorphoMidnightTenorSiUSDUSDC_20261030_Eth = "morphomidnighttenorsiusdusdc_20261030_eth", MorphoMidnightTenorSiUSDUSDC_20261127_Eth = "morphomidnighttenorsiusdusdc_20261127_eth", MorphoMidnightTenorSiUSDUSDC_20261225_Eth = "morphomidnighttenorsiusdusdc_20261225_eth", MorphoMidnightTenorStrUSDUSDC_20260925_Eth = "morphomidnighttenorstrusdusdc_20260925_eth", MorphoMidnightTenorStrUSDUSDC_20261030_Eth = "morphomidnighttenorstrusdusdc_20261030_eth", MorphoMidnightTenorStrUSDUSDC_20261127_Eth = "morphomidnighttenorstrusdusdc_20261127_eth", MorphoMidnightTenorStrUSDUSDC_20261225_Eth = "morphomidnighttenorstrusdusdc_20261225_eth", MorphoMidnightTenorUSD3USDC_20260925_Eth = "morphomidnighttenorusd3usdc_20260925_eth", MorphoMidnightTenorUSD3USDC_20261030_Eth = "morphomidnighttenorusd3usdc_20261030_eth", MorphoMidnightTenorUSD3USDC_20261127_Eth = "morphomidnighttenorusd3usdc_20261127_eth", MorphoMidnightTenorUSD3USDC_20261225_Eth = "morphomidnighttenorusd3usdc_20261225_eth", MorphoMidnightTenorWETHUSDC_20260925_Eth = "morphomidnighttenorwethusdc_20260925_eth", MorphoMidnightTenorWETHUSDC_20261030_Eth = "morphomidnighttenorwethusdc_20261030_eth", MorphoMidnightTenorWETHUSDC_20261127_Eth = "morphomidnighttenorwethusdc_20261127_eth", MorphoMidnightTenorWETHUSDC_20261225_Eth = "morphomidnighttenorwethusdc_20261225_eth", MorphoMidnightTenorWsrUSDUSDC_20260925_Eth = "morphomidnighttenorwsrusdusdc_20260925_eth", MorphoMidnightTenorWsrUSDUSDC_20261030_Eth = "morphomidnighttenorwsrusdusdc_20261030_eth", MorphoMidnightTenorWsrUSDUSDC_20261127_Eth = "morphomidnighttenorwsrusdusdc_20261127_eth", MorphoMidnightTenorWsrUSDUSDC_20261225_Eth = "morphomidnighttenorwsrusdusdc_20261225_eth", MorphoMidnightTenorWstETHWETH_20260925_Eth = "morphomidnighttenorwstethweth_20260925_eth", MorphoMidnightTenorWstETHWETH_20261030_Eth = "morphomidnighttenorwstethweth_20261030_eth", MorphoMidnightTenorWstETHWETH_20261127_Eth = "morphomidnighttenorwstethweth_20261127_eth", MorphoMidnightTenorWstETHWETH_20261225_Eth = "morphomidnighttenorwstethweth_20261225_eth" } export type MorphoMidnightCurator = 'Morpho' | 'Tenor'; export interface MorphoMidnightCollateralParams { token: EthAddress; lltv: number | string; liquidationCursor: number | string; oracle: EthAddress; /** * A collateral the market carries on-chain but the app never surfaces: a curator's own vault share * token (Tenor's collateral vaults) or the loan token itself (Morpho's mainnet ladders list USDC at * 98% next to the real collateral). It is not an asset the app deals in — nothing renders, prices or * supplies it — but it stays in `collaterals` because the market id is the hash of the full set. */ hidden?: boolean; } export interface MorphoMidnightMarketData { chainIds: NetworkNumber[]; label: string; shortLabel: string; url: string; value: MorphoMidnightVersions; midnight: EthAddress; loanToken: EthAddress; /** * Every collateral the market carries on-chain, in the chain's own order — which is what the id is * hashed from, so neither the set nor the order may be rearranged. Entries the app does not deal in * are flagged `hidden` rather than kept in a second list: their on-chain position varies per market * (Morpho's mainnet cbBTC ladder lists USDC first, its WBTC ladder second), so a separate list can * only be re-joined by guessing, and every positional read — `MarketInfo.prices[i]`, * `PositionInfo.collateral[i]`, the collateral index a supply call takes — indexes into *this* array. */ collaterals: MorphoMidnightCollateralParams[]; maturity: number; rcfThreshold: number | string; enterGate: EthAddress; liquidatorGate: EthAddress; marketId: string; protocolName: string; curator: MorphoMidnightCurator; } export interface MorphoMidnightAssetData { symbol: string; address: string; price: string; supplyRate: string; borrowRate: string; supplyIncentives: IncentiveData[]; borrowIncentives: IncentiveData[]; totalSupply?: string; totalBorrow?: string; canBeSupplied?: boolean; canBeBorrowed?: boolean; lltv?: string; } export type MorphoMidnightAssetsData = { [key: string]: MorphoMidnightAssetData; }; export interface MorphoMidnightMarketInfo { id: string; isCreated: boolean; loanToken: string; collaterals: string[]; maturity: number; isMatured: boolean; totalUnits: string; withdrawable: string; totalDebt: string; lossFactor: string; tickSpacing: number; utillization: string; assetsData: MorphoMidnightAssetsData; } export type MorphoMidnightBookSide = 'bids' | 'asks'; export interface MorphoMidnightBookOffer { rate: string; liquidity: string; } export interface MorphoMidnightParsedBook { bestRate: string; totalLiquidity: string; offers: MorphoMidnightBookOffer[]; } export interface MorphoMidnightAggregatedPositionData { suppliedUsd: string; suppliedCollateralUsd: string; borrowedUsd: string; borrowLimitUsd: string; liquidationLimitUsd: string; leftToBorrowUsd: string; leftToBorrow: string; netApy: string; incentiveUsd: string; totalInterestUsd: string; ltv: string; ratio: string; healthRatio: string; safetyRatio: string; leveragedType: LeverageType; leveragedAsset?: string; currentVolatilePairRatio?: string; liquidationPrice?: string; minCollRatio?: string; collLiquidationRatio?: string; exposure: string; } /** * How much weight `borrowRate` / `debtBase` / `debtInterest` carry on a given position. They fall back to * `'0'` / `debt` / `'0'`, which is indistinguishable from a real 0%-interest position, so anything * displaying them has to read this to know whether it is looking at a number or at a placeholder. * * - `Available` — reported and reconciled against the on-chain debt (also lenders and debt-free positions, * which have nothing to report). * - `Pending` — the indexer has not caught up with the chain yet: it does not know the position, or its * split describes a different debt. Refetching resolves it; `getMorphoMidnightUserBorrowInfo` failing * outright lands here too, since the next call may well succeed. */ export declare enum MorphoMidnightBorrowInfoStatus { Available = "available", Pending = "pending" } export interface MorphoMidnightPositionData extends MorphoMidnightAggregatedPositionData { usedAssets: MMUsedAssets; credit: string; debt: string; borrowRate: string; debtBase: string; debtInterest: string; borrowInfoStatus: MorphoMidnightBorrowInfoStatus; maturity: number; isMatured: boolean; }