nfrax logonfrax

Infrastructure that just works. Ship products, not boilerplate.

Frameworks

  • svc-infra
  • ai-infra
  • fin-infra
  • robo-infra

Resources

  • Getting Started
  • What's New
  • Contributing

Community

  • GitHub

© 2026 nfrax. All rights reserved.

nfrax logonfrax
Start HereWhat's New
GitHub
fin-infra / API Reference

NetWorthTracker

from fin_infra.net_worth.ease import NetWorthTracker
View source
fin_infra.net_worth.ease

High-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**:

python
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**:

python
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
})
Constructor
NetWorthTracker(aggregator: NetWorthAggregator, insights_generator: Any = None, goal_tracker: Any = None, conversation: Any = None)
ParameterTypeDefaultDescription
aggregatorrequiredNetWorthAggregator—NetWorthAggregator instance (required)
insights_generatorAnyNoneNetWorthInsightsGenerator instance (optional, V2)
goal_trackerAnyNoneFinancialGoalTracker instance (optional, V2)
conversationAnyNoneFinancialPlanningConversation instance (optional, V2)

Methods

On This Page

Constructorcalculate_net_worthcreate_snapshotget_snapshots