import { AprData, BalanceData } from '../fetch-balances/types';
/**
 * Calculates weighted average
 * @param items Array of { value: number, weight: number }
 * @returns Weighted average, or 0 if total weight is 0
 */
export declare function calculateWeightedAverage(items: {
    value: number;
    weight: number;
}[]): number;
/**
 * Calculates net APR for a sub-account based on deposits and debt
 */
export declare function calculateNetApr(aprData: AprData, balanceData: BalanceData): number;
/**
 * Calculates leverage ratio
 * @returns leverage = deposits / netWorth, or 0 if netWorth <= 0
 */
export declare function calculateLeverage(deposits: number, netWorth: number): number;
/**
 * Calculates overall net APR from totals
 */
export declare function calculateOverallNetApr(totalDepositsUSD: number, totalDebtUSD: number, avgDepositApr: number, avgBorrowApr: number): number;
export interface AprWeightItem {
    deposits: number;
    debt: number;
    nav: number;
    apr: number;
    depositApr: number;
    borrowApr: number;
    rewardApr: number;
    rewardDepositApr: number;
    rewardBorrowApr: number;
    intrinsicApr: number;
    intrinsicDepositApr: number;
    intrinsicBorrowApr: number;
}
/**
 * Computes all weighted APR fields from a set of items.
 *
 * Weighting rules:
 * - Deposit-side APRs (depositApr, rewardDepositApr, intrinsicDepositApr) → weighted by deposits
 * - Borrow-side APRs (borrowApr, rewardBorrowApr, intrinsicBorrowApr) → weighted by debt
 * - Net APRs (apr, rewardApr, intrinsicApr) → weighted by nav
 */
export declare function calculateWeightedAprs(items: AprWeightItem[]): {
    apr: number;
    depositApr: number;
    borrowApr: number;
    rewardApr: number;
    rewardDepositApr: number;
    rewardBorrowApr: number;
    intrinsicApr: number;
    intrinsicDepositApr: number;
    intrinsicBorrowApr: number;
};
//# sourceMappingURL=utils.d.ts.map