/** * Aerodrome APY Engine — computes yield on-chain from gauge + pool data * * APY = (gauge.rewardRate × AERO_price × 365 × 86400) / poolTVL + feeAPY * * Uses the existing Aerodrome router to price AERO in USDC. * Caches results for 5 minutes (LP APY moves slowly). */ import { ethers } from 'ethers'; import { formatAPY, formatTVL } from '../lend/morpho-api'; export { formatAPY, formatTVL }; export interface PoolMetrics { /** Total APY as decimal (0.076 = 7.6%) — emissions + estimated fees */ apy: number; /** Emission APY as decimal */ apyEmissions: number; /** Fee APY as decimal (estimated from recent data) */ apyFees: number; /** TVL in USD */ tvlUsd: number; /** AERO price in USD */ aeroPrice: number; } /** Clear cache (for testing) */ export declare function clearPoolMetricsCache(): void; export declare function getFallbackAPY(poolKey: string): { range: string; midpoint: number; }; /** * Fetch metrics for all registered pools using on-chain data. * Returns null on failure (callers should use fallback). */ export declare function fetchAllPoolMetrics(provider: ethers.Provider): Promise | null>; /** * Fetch metrics for a single pool by key. */ export declare function fetchPoolMetrics(key: string, provider: ethers.Provider): Promise;