analyze_portfolio
Compute portfolio performance from transaction history: holdings, average cost, market value, unrealized/realized profit, dividends, returns, concentration, drawdown, and benchmark comparisons.
Instructions
Use it whenever the user tells you about shares they bought or sold, by count and date ("500 SISE in January 2023, sold them all in July 2025"), even a single purchase or a position already closed. Analyze an actual brokerage account from its transactions (buys, sells, cash dividends received, bonus issues): each holding's quantity, average cost, market value, weight, unrealized and realized profit, dividends and total result; account totals and the money-weighted annual return; concentration (largest holding, top three, by currency); best and worst holding; and the current holdings' volatility and maximum drawdown over the last year. Use it for "how is my portfolio doing", "which stock lost me the most", "what is my cost", and, with compare_with, "how did my portfolio do against BIST 100 (or gold, another share)": it then compares each holding over its own period and the whole account over its own cash flows. For "did my savings keep up with inflation" use portfolio_real_return. Only symbol, date and quantity are needed: call it with what the user gave rather than asking for prices, days or fees first (missing prices use the day's close, a month alone uses its first session, and the result flags both). Describes the past, not what to buy or sell.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| currency | No | Report currency; defaults to the first asset's currency. | |
| compare_with | No | Only when the user asks how the holdings did against something: a symbol from search_assets (e.g. 'XU100.IS' for BIST 100, 'XU030.IS', gold). Each holding gets that symbol's move over the holding's own period. | |
| transactions | Yes | The account's transactions. |