//#region extensions/crypto/src/services/portfolio-snapshot.d.ts /** * Portfolio Snapshot Service — multi-chain balance aggregation and analysis. * * Provides: * - Cross-chain portfolio value (Ethereum, Base, Arbitrum, Optimism, Polygon) * - Token-by-token breakdown with allocation percentages * - Native + ERC-20 balances with USD values * - Historical comparison (P&L since last snapshot) * - Risk metrics (concentration, stablecoin ratio) */ interface TokenBalance { symbol: string; address: string; chain: string; chainId: number; balance: string; balanceHuman: number; decimals: number; priceUsd: number; valueUsd: number; allocationPercent: number; } interface ChainSummary { chain: string; chainId: number; valueUsd: number; allocationPercent: number; tokenCount: number; } interface PortfolioSnapshot { owner: string; totalValueUsd: number; chains: ChainSummary[]; tokens: TokenBalance[]; stablecoinRatio: number; topConcentration: number; riskLevel: 'conservative' | 'moderate' | 'aggressive'; timestamp: number; } interface PortfolioChange { current: PortfolioSnapshot; previous: PortfolioSnapshot | null; changeUsd: number; changePercent: number; newPositions: string[]; closedPositions: string[]; } interface PortfolioConfig { /** Chains to scan. Default: all supported. */ chainIds?: number[]; /** Minimum balance in USD to include a token. Default: 0.01 */ minValueUsd?: number; /** Cache TTL for snapshots in ms. Default: 60000 (1 minute). */ cacheTtlMs?: number; } declare class PortfolioSnapshotService { private config; private cache; private previousSnapshots; private static readonly MAX_SNAPSHOTS; constructor(config?: PortfolioConfig); /** * Take a full portfolio snapshot across all configured chains. */ getSnapshot(ownerAddress: string): Promise; /** * Get portfolio change since last snapshot. */ getChange(ownerAddress: string): Promise; /** * Get supported chains. */ getSupportedChains(): Array<{ chainId: number; name: string; }>; /** Clear the snapshot cache and previous snapshots. */ clearCache(): void; private isStablecoin; } declare function getPortfolioService(config?: PortfolioConfig): PortfolioSnapshotService; declare function resetPortfolioService(): void; //#endregion export { ChainSummary, PortfolioChange, PortfolioConfig, PortfolioSnapshot, PortfolioSnapshotService, TokenBalance, getPortfolioService, resetPortfolioService }; //# sourceMappingURL=portfolio-snapshot.d.mts.map