@sei-code/analytics
Version:
Blockchain data analysis and monitoring for Sei network
81 lines • 2.4 kB
TypeScript
import { SeiAgent, BaseCapability } from '@sei-code/core';
import { SeiPrecompileManager } from '@sei-code/precompiles';
interface PortfolioSnapshot {
timestamp: string;
totalValue: string;
assets: PortfolioAsset[];
performance: PerformanceMetrics;
}
interface PortfolioAsset {
denom: string;
symbol: string;
balance: string;
value: string;
price: string;
allocation: number;
type: 'liquid' | 'staked' | 'rewards';
change24h?: number;
}
interface PerformanceMetrics {
totalReturn: string;
totalReturnPercentage: number;
dailyReturn: string;
dailyReturnPercentage: number;
bestAsset: string;
worstAsset: string;
diversificationScore: number;
}
export declare class PortfolioAnalyzer extends BaseCapability {
private precompiles;
private snapshots;
private agent;
constructor(agent: SeiAgent, precompiles: SeiPrecompileManager);
execute(params: any): Promise<any>;
analyzePortfolio(userAddress: string): Promise<PortfolioSnapshot>;
private getAllDelegations;
private buildAssetList;
private calculateTotalValue;
private calculatePerformance;
private calculateDiversificationScore;
private getSymbolFromDenom;
private saveSnapshot;
getPortfolioHistory(userAddress: string): Promise<PortfolioSnapshot[]>;
comparePortfolios(addresses: string[]): Promise<{
portfolios: Array<{
address: string;
snapshot: PortfolioSnapshot;
}>;
comparison: {
bestPerformer: string;
worstPerformer: string;
averageValue: string;
totalCombinedValue: string;
};
}>;
getAssetAllocation(userAddress: string): Promise<{
liquid: number;
staked: number;
rewards: number;
breakdown: Array<{
asset: string;
percentage: number;
value: string;
}>;
}>;
trackPerformanceOverTime(userAddress: string, days?: number): Promise<{
data: Array<{
date: string;
value: string;
change: number;
}>;
summary: {
totalReturn: string;
totalReturnPercentage: number;
bestDay: string;
worstDay: string;
volatility: number;
};
}>;
}
export {};
//# sourceMappingURL=portfolio-analyzer.d.ts.map