web3agent-aof
Version:
AI Framework for Onchain Operations and DeFi Interactions
34 lines (33 loc) • 779 B
TypeScript
export interface Position {
token: string;
amount: string;
entryPrice: number;
currentPrice: number;
protocol?: string;
type: 'spot' | 'liquidity' | 'lending' | 'borrowing';
}
export interface Trade {
timestamp: number;
token: string;
type: 'buy' | 'sell';
amount: string;
price: number;
txHash: string;
}
export interface PortfolioAnalytics {
sharpeRatio: number;
volatility: number;
maxDrawdown: number;
historicalReturns: number;
impermanentLoss: number;
activePositions: Position[];
historicalTrades: Trade[];
totalValue: string;
tokenAllocations: Map<string, number>;
}
export interface PortfolioBalance {
token: string;
amount: string;
value: string;
allocation: number;
}