import { BaseLendingPositions } from '../../../types';
import { RewardsList } from '../../../types/apiReturnType';
import { AprData, BalanceData, UserConfig } from '../fetch-balances/types';
export type MarketConfigEntry = {
    category: string;
    label: string;
    borrowCollateralFactor: number | null;
    collateralFactor: number | null;
    borrowFactor: number | null;
    /** Liquidation penalty for this mode as a fraction of repaid debt (e.g. 0.05 = 5%). */
    liquidationPenalty: number | null;
    /** Max fraction of debt repayable per liquidation (0..1); mirrors the pool-level value. */
    closeFactor: number | null;
    /** Liquidation target health factor (Aave V4); null/absent where unsupported. */
    targetHealthFactor?: number | null;
    debtDisabled: boolean;
    collateralDisabled: boolean;
};
export type MarketConfigs = Record<string, MarketConfigEntry>;
export type MarketFlags = {
    isActive: boolean | null;
    isFrozen: boolean | null;
    hasStable: boolean | null;
    borrowingEnabled: boolean | null;
    collateralActive: boolean | null;
};
export type AssetInfo = {
    chainId: string | null;
    address: string | null;
    symbol: string | null;
    name: string | null;
    decimals: number | null;
    logoURI: string | null;
    assetGroup: string | null;
    currencyId: string | null;
    props: unknown | null;
};
export type PriceInfo = {
    priceUsd: number | null;
    priceTs: any | null;
    priceUsd24h: number | null;
    priceTs24h: any | null;
    priceChange24h: number | null;
};
export type OraclePrice = {
    oraclePrice: number | null;
    oraclePriceUsd: number | null;
};
export type SumerMarketMeta = {
    groupId: number;
    isCToken: boolean;
    intraCRate: number;
    intraMintRate: number;
    intraSuRate: number;
    interCRate: number;
    interSuRate: number;
};
export type CompoundV2Metadata = {
    cToken: string;
    exchangeRate: string | undefined;
    cTokenDecimals: number | undefined;
    sumer?: SumerMarketMeta;
};
export type AaveMetadata = {
    aToken: string;
    vToken: string | undefined;
    sToken: string | undefined;
};
export type InitMetadata = {
    poolId: string;
};
export type EulerV2Metadata = {
    vault: string;
    dToken: string | undefined;
    oracle: string | undefined;
    interestRateModel: string | undefined;
    unitOfAccount: string | undefined;
    governorAdmin: string | undefined;
};
export type SiloV2Metadata = {
    silo: string;
    counterpartySilo: string;
    siloConfig: string;
    oracle: string;
    irm: string;
    shareTokens: {
        collateral: string;
        protected: string;
        debt: string;
    };
    fees: {
        dao: string;
        deployer: string;
        liquidation: string;
        flashloan: string;
    };
};
export type ProtocolParams = {
    metadata: CompoundV2Metadata;
} | {
    metadata: AaveMetadata;
} | {
    metadata: InitMetadata;
} | {
    metadata: EulerV2Metadata;
} | {
    metadata: SiloV2Metadata;
};
export type LenderYieldComplete = {
    depositRate: number | null;
    stableBorrowRate: number | null;
    variableBorrowRate: number | null;
    intrinsicYield: number | null;
    underlying: string;
    configs: MarketConfigs | null;
    flags: MarketFlags | null;
    rewards: RewardsList | null;
    asset: AssetInfo;
    price: PriceInfo;
    oraclePrice?: OraclePrice;
    borrowLiquidity: number | null;
    withdrawLiquidity: number | null;
    depositable: number | null;
    /** Max fraction of debt repayable per liquidation (0..1); pool-level constant. */
    closeFactor?: number | null;
    /** Liquidation target health factor (Aave V4); null/absent where unsupported. */
    targetHealthFactor?: number | null;
    params?: ProtocolParams;
};
export type LenderCrossPoolMeta = Record<string, LenderYieldComplete>;
export type LenderToLenderCrossPoolMeta = Record<string, LenderCrossPoolMeta>;
export type LenderYieldCompleteResult = Record<string, LenderToLenderCrossPoolMeta>;
export type UnderlyingInfo = {
    asset: AssetInfo;
    oraclePrice?: OraclePrice;
    prices: PriceInfo;
};
/** Build an `underlyingInfo` object from cached lender metadata. */
export declare function buildUnderlyingInfo(meta: LenderYieldComplete): UnderlyingInfo;
export declare function getAssetsFromMeta(meta?: LenderCrossPoolMeta): string[] | undefined;
export declare function getMarketUidsFromMeta(meta: LenderCrossPoolMeta): string[];
export interface UserDataForSubAccount {
    accountId: string;
    health: number | null;
    /** Total USD borrowable while maintaining health >= 1 */
    borrowCapacityUSD: number;
    balanceData: BalanceData;
    aprData: AprData;
    positions: BaseLendingPositions[];
    userConfig: UserConfig;
}
export type LenderInfo = {
    lenderKey: string;
    name: string;
    logoUri: string | null;
};
/** Map of lender key → LenderInfo, typically scoped to one chain. */
export type LenderInfoMap = Record<string, LenderInfo>;
export type UserData = {
    lender: string;
    chainId: string;
    account: string;
    data: UserDataForSubAccount[];
};
//# sourceMappingURL=types.d.ts.map