Documentation

Obol - Portfolio networth calculator with real-time price fetching

This crate provides functionality to calculate the total networth of a portfolio by fetching current prices for various asset types including currencies, stocks, and cryptocurrencies.

Quick Start

use obol::{PortfolioBuilder, CombinedPriceProvider, PortfolioConfig};
use rust_decimal::Decimal;

# tokio_test::block_on(async {
let mut config = PortfolioConfig::default();
config.currencies.insert("USD".to_string(), Decimal::from(1000));
config.stocks.insert("AAPL".to_string(), 10);

let provider = Box::new(CombinedPriceProvider::new());
let portfolio = PortfolioBuilder::new(config)
    .base_currency("USD")
    .with_price_provider(provider)
    .build()
    .await?;

println!("Total networth: {}", portfolio.total_networth());
# Ok::<(), obol::Error>(())
# });