/** * Risk Scoring Utility * * Multi-factor risk analysis algorithms for vault assessment. * Provides comprehensive risk scoring across multiple dimensions. */ /** * Risk score breakdown by category */ export interface RiskScoreBreakdown { tvlRisk: number; concentrationRisk: number; volatilityRisk: number; ageRisk: number; curatorRisk: number; feeRisk: number; liquidityRisk: number; aprConsistencyRisk: number; yieldSustainabilityRisk: number; settlementRisk: number; integrationComplexityRisk: number; capacityUtilizationRisk: number; protocolDiversificationRisk: number; topProtocolConcentrationRisk: number; overallRisk: number; riskLevel: 'Low' | 'Medium' | 'High' | 'Critical'; /** * Indicates the quality of data used for risk analysis. * - 'high': All data sources available, calculations based on real data * - 'medium': Some data missing, using defaults for 1-2 factors * - 'low': Significant data gaps, multiple factors using default assumptions */ dataQuality: 'high' | 'medium' | 'low'; /** * Specific notes about data limitations affecting the risk analysis. * Empty array indicates all data was available and of good quality. */ dataQualityNotes: string[]; ageInDays?: number; averageSettlementDays?: number; } /** * Risk thresholds for scoring */ export declare const RISK_THRESHOLDS: { TVL_VERY_HIGH: number; TVL_HIGH: number; TVL_MEDIUM: number; TVL_LOW: number; CONCENTRATION_LOW: number; CONCENTRATION_MEDIUM: number; CONCENTRATION_HIGH: number; VOLATILITY_LOW: number; VOLATILITY_MEDIUM: number; VOLATILITY_HIGH: number; AGE_MATURE: number; AGE_ESTABLISHED: number; AGE_NEW: number; OVERALL_LOW: number; OVERALL_MEDIUM: number; OVERALL_HIGH: number; }; /** * Calculate TVL-based risk score * Higher TVL = lower risk (more liquidity and market validation) * * @param tvl - Total value locked in USD * @returns Risk score 0-1 (0 = lowest risk, 1 = highest risk) */ export declare function calculateTVLRisk(tvl: number): number; /** * Calculate concentration risk score * Measures vault's share of total protocol TVL * * @param vaultTVL - Vault's TVL in USD * @param totalProtocolTVL - Total protocol TVL in USD * @returns Risk score 0-1 (0 = lowest risk, 1 = highest risk) */ export declare function calculateConcentrationRisk(vaultTVL: number, totalProtocolTVL: number): number; /** * Calculate volatility risk score * Based on price volatility over time * * @param pricePoints - Array of price per share values over time * @returns Risk score 0-1 (0 = lowest risk, 1 = highest risk) */ export declare function calculateVolatilityRisk(pricePoints: number[]): number; /** * Calculate age-based risk score * Newer vaults are riskier (less battle-tested) * * @param ageInDays - Vault age in days * @returns Risk score 0-1 (0 = lowest risk, 1 = highest risk) */ export declare function calculateAgeRisk(ageInDays: number): number; /** * Calculate curator reputation risk score * Based on curator's track record, professional signals, and vault management * * @param curatorVaultCount - Number of vaults managed by curator * @param curatorSuccessRate - Success rate (0-1) of curator's vaults * @param professionalSignals - Professional indicators: website, description, multiple curators * @returns Risk score 0-1 (0 = lowest risk, 1 = highest risk) */ export declare function calculateCuratorRisk(curatorVaultCount: number, curatorSuccessRate?: number, professionalSignals?: { hasWebsite: boolean; hasDescription: boolean; multipleCurators: boolean; curatorCount: number; }): number; /** * Calculate fee risk score * Based on management fees and performance fee impact * * @param managementFee - Annual management fee percentage (e.g., 2 for 2%) * @param performanceFee - Performance fee percentage (e.g., 20 for 20%) * @param performanceFeeActive - Whether performance fee is currently active (above HWM) * @returns Risk score 0-1 (0 = lowest risk, 1 = highest risk) */ export declare function calculateFeeRisk(managementFee: number, performanceFee: number, performanceFeeActive: boolean): number; /** * Calculate liquidity risk score * Based on safe assets vs pending redemptions coverage * * @param safeAssets - Assets available for immediate redemptions (USD) * @param pendingRedemptions - Outstanding redemption requests (USD) * @returns Risk score 0-1 (0 = lowest risk, 1 = highest risk) */ export declare function calculateLiquidityRisk(safeAssets: number, pendingRedemptions: number): number; /** * Calculate APR consistency risk score * Analyzes volatility of returns across different time periods * * @param aprData - APR values across different time periods * @returns Risk score 0-1 (0 = lowest risk, 1 = highest risk) */ export declare function calculateAPRConsistencyRisk(aprData: { weeklyApr?: number; monthlyApr?: number; yearlyApr?: number; inceptionApr?: number; }): number; /** * Calculate yield sustainability risk score * Assesses composition of APR sources (native vs temporary incentives) * * @param yieldComposition - Breakdown of yield sources * @returns Risk score 0-1 (0 = lowest risk, 1 = highest risk) */ export declare function calculateYieldSustainabilityRisk(yieldComposition: { totalApr: number; nativeYieldsApr: number; airdropsApr: number; incentivesApr: number; }): number; /** * Calculate settlement time risk score * Quantifies redemption delay and operational efficiency * * @param settlementData - Settlement time and pending operations data * @returns Risk score 0-1 (0 = lowest risk, 1 = highest risk) */ export declare function calculateSettlementRisk(settlementData: { averageSettlementDays: number; pendingOperationsRatio: number; }): number; /** * Calculate integration complexity risk score * Assesses smart contract attack surface based on number of integrations * * @param integrationCount - Number of DeFi protocol integrations * @returns Risk score 0-1 (0 = lowest risk, 1 = highest risk) */ export declare function calculateIntegrationComplexityRisk(integrationCount: number): number; /** * Calculate protocol diversification risk based on HHI (Herfindahl-Hirschman Index) * * HHI measures concentration: sum of squared market shares * - HHI < 0.15: Well diversified across protocols * - HHI 0.15-0.25: Moderate concentration * - HHI 0.25-0.50: High concentration * - HHI > 0.50: Very high concentration (single protocol dominance) * * @param compositions - Array of protocol compositions with repartition (0-100%) * @returns Risk score 0-1 (lower = better diversification) */ export declare function calculateProtocolDiversificationRisk(compositions: Array<{ repartition: number; }> | null | undefined): number; /** * Calculate top protocol concentration risk * * Evaluates the risk of having too much exposure to a single protocol. * Complements HHI by specifically flagging dominant protocol exposure. * * @param topProtocolPercent - Percentage allocation to top protocol (0-100 or null) * @returns Risk score 0-1 (lower = healthier distribution) */ export declare function calculateTopProtocolConcentrationRisk(topProtocolPercent: number | null | undefined): number; /** * Calculate capacity utilization risk score * Assesses deposit headroom and demand signals * * @param utilizationData - Capacity and utilization data * @returns Risk score 0-1 (0 = lowest risk, 1 = highest risk) */ export declare function calculateCapacityUtilizationRisk(utilizationData: { totalAssets: number; maxCapacity: number | null; }): number; /** * Risk factor weights for calculating overall risk score. * * Weights are derived from DeFi risk research and empirical analysis: * * **Market & Liquidity (24%)** * - TVL (8%): Liquidity depth and market validation signal * - Concentration (8%): Protocol-wide exposure and systemic risk * - Liquidity (8%): Redemption coverage and operational liquidity * * **Performance & Stability (27%)** * - Volatility (14%): Primary indicator of price instability and risk * - APR Consistency (13%): Yield reliability signals strategy health * * **Operational (21%)** * - Age (8%): Operational track record and battle-testing * - Curator (8%): Management quality and experience * - Settlement (5%): Operational efficiency and delay risk * * **Fee Structure (8%)** * - Fee (8%): Cost drag on returns and alignment of interests * * **Strategy Composition (20%)** * - Yield Sustainability (5%): Native vs incentive-based yield mix * - Integration Complexity (5%): Smart contract attack surface * - Capacity Utilization (5%): Demand signals and deposit headroom * - Protocol Diversification (5%): HHI-based protocol concentration * - Top Protocol Concentration (5%): Single protocol exposure risk * * Total: 100% (weights sum to 1.0) */ export declare const RISK_WEIGHTS: { readonly tvl: 0.08; readonly concentration: 0.08; readonly volatility: 0.14; readonly age: 0.08; readonly curator: 0.08; readonly fee: 0.08; readonly liquidity: 0.08; readonly aprConsistency: 0.13; readonly yieldSustainability: 0.05; readonly settlement: 0.05; readonly integrationComplexity: 0.05; readonly capacityUtilization: 0.05; readonly protocolDiversification: 0.05; readonly topProtocolConcentration: 0.05; }; /** * Calculate overall risk score with weighted factors * * @param breakdown - Individual risk factor scores (excluding overall and data quality fields) * @returns Overall risk score 0-1 and risk level */ export declare function calculateOverallRisk(breakdown: Omit): { overallRisk: number; riskLevel: 'Low' | 'Medium' | 'High' | 'Critical'; }; /** * Generate comprehensive risk analysis * * @param params - Risk analysis parameters * @returns Complete risk score breakdown */ export declare function analyzeRisk(params: { tvl: number; totalProtocolTVL: number; priceHistory: number[]; ageInDays: number; curatorVaultCount: number; curatorSuccessRate?: number; curatorProfessionalSignals?: { hasWebsite: boolean; hasDescription: boolean; multipleCurators: boolean; curatorCount: number; }; managementFee: number; performanceFee: number; performanceFeeActive: boolean; safeAssets: number; pendingRedemptions: number; aprData?: { weeklyApr?: number; monthlyApr?: number; yearlyApr?: number; inceptionApr?: number; }; yieldComposition?: { totalApr: number; nativeYieldsApr: number; airdropsApr: number; incentivesApr: number; }; settlementData?: { averageSettlementDays: number; pendingOperationsRatio: number; }; integrationCount?: number; capacityData?: { totalAssets: number; maxCapacity: number | null; }; compositionData?: { compositions?: Array<{ repartition: number; }>; topProtocolPercent?: number | null; }; }): RiskScoreBreakdown; //# sourceMappingURL=risk-scoring.d.ts.map