from fin_infra.net_worth.ease import NetWorthTrackerHigh-level net worth tracking interface. Provides simple methods for calculating net worth, creating snapshots, and retrieving history. **V1 Features** (Always Available): - `calculate_net_worth()`: Real-time net worth calculation (<100ms, $0 cost) - `create_snapshot()`: Store snapshot in database - `get_snapshots()`: Retrieve historical snapshots **V2 Features** (When enable_llm=True): - `generate_insights()`: LLM-generated financial insights ($0.042/user/month) - `ask()`: Multi-turn financial planning conversation ($0.018/user/month) - `validate_goal()`: LLM-validated goal tracking ($0.0036/user/month) - `track_goal_progress()`: Weekly progress reports with course correction **Example - V1 Only**:
tracker = NetWorthTracker(aggregator)
# Calculate current net worth
snapshot = await tracker.calculate_net_worth("user_123")
# Create snapshot in database
await tracker.create_snapshot("user_123")
# Get historical snapshots
history = await tracker.get_snapshots("user_123", days=90)**Example - V2 with LLM**:
tracker = NetWorthTracker(
aggregator=aggregator,
insights_generator=insights_generator,
goal_tracker=goal_tracker,
conversation=conversation,
)
# V1 features still work
snapshot = await tracker.calculate_net_worth("user_123")
# V2 features now available
insights = await tracker.generate_insights("user_123", type="wealth_trends")
response = await tracker.ask("How can I save more?", "user_123")
goal = await tracker.validate_goal({
"type": "retirement",
"target_amount": 2000000.0,
"target_age": 65
})