import { AprData, BalanceData, UserConfig } from '../fetch-balances/types';
import { LenderInfo, UserData, UserDataForSubAccount } from '../utils/types';
/**
 * Summary-level balance data.
 * Same shape as BalanceData but without discounted/adjusted fields
 * that are only meaningful at the sub-account risk level.
 */
export interface SummaryBalanceData {
    deposits: number;
    debt: number;
    collateral: number;
    collateralAllActive: number;
    nav: number;
    deposits24h: number;
    debt24h: number;
    nav24h: number;
    rewards?: any;
}
/**
 * Summary-level APR data (same shape as AprData).
 */
export interface SummaryAprData {
    apr: number;
    depositApr: number;
    borrowApr: number;
    rewardApr: number;
    rewardDepositApr: number;
    rewardBorrowApr: number;
    intrinsicApr: number;
    intrinsicDepositApr: number;
    intrinsicBorrowApr: number;
    rewards: any;
}
/**
 * Summary for a sub-account within a lender
 */
export interface SubAccountSummary {
    accountId: string;
    health: number | null;
    balanceData: BalanceData;
    aprData: AprData;
    userConfig: UserConfig;
    positionCount: number;
}
/**
 * Summary for a single lender/market
 */
export interface LenderSummary {
    lender: string;
    chainId: string;
    balanceData: SummaryBalanceData;
    aprData: SummaryAprData;
    /** Leverage ratio (deposits / (deposits - debt)) */
    leverage: number;
    /** Sub-account info */
    subAccounts: SubAccountSummary[];
}
/**
 * Summary for a single chain
 */
export interface ChainSummary {
    chainId: string;
    totalDepositsUSD: number;
    totalDebtUSD: number;
    netWorth: number;
    lenderCount: number;
}
/**
 * Lightweight totals-only summary (no per-lender breakdown or positions)
 */
export interface PortfolioTotals {
    balanceData: SummaryBalanceData;
    aprData: SummaryAprData;
    leverage: number;
    activeLenders: number;
    activeChains: number;
}
/**
 * Overall portfolio summary across all lenders and chains
 */
export interface PortfolioSummary extends PortfolioTotals {
    /** Per-lender summaries (array, sorted by netWorth descending) */
    lenders: LenderSummary[];
    /** Per-chain totals */
    chains: ChainSummary[];
}
/**
 * Fused lender entry: UserData positions + aggregated LenderSummary metrics.
 * Used in the API response to avoid separate data + summary lookups.
 */
export interface LenderDataEntry extends Omit<LenderSummary, 'subAccounts'> {
    account: string;
    lenderInfo?: LenderInfo;
    data: UserDataForSubAccount[];
}
/**
 * Input type for buildSummaries - user data result from convertLenderUserDataResult
 */
export type UserDataResult = {
    [chainId: string]: {
        [lender: string]: UserData;
    };
};
//# sourceMappingURL=types.d.ts.map