Urgent.News

What's breaking now, across thousands of outlets.

Tech

My broker said I'd made $18,000. The number was an aggregate over a query nobody could show me.

The number sat on my broker's home screen, green, precise to two decimals. Roughly eighteen thousand dollars, earned from investing, over the whole period I'd been at it. I looked at it for a long time and realised I didn't know what it included. Dividends — reinvested ones, or only the ones that landed as cash? Before or after the tax withheld in a country I don't live in? Closed positions, or…

The broker's screen displayed an aggregate investment amount of $18,000, which seemed precise to two decimal places. This figure, representing earnings from investments, spanned the entire duration of the user's involvement. However, the user was uncertain about what components made up this total. Factors included reinvested dividends, whether they were paid before or after taxes, open or closed positions, fees, and the starting point of the measurement period.

The user noticed that this aggregate could vary significantly depending on these factors, each potentially shifting the total by thousands of dollars. This situation is common in financial tracking: an aggregate number generated from data that cannot be individually traced or verified. After searching for detailed breakdowns, the user discovered that such information was not available.

They were a self-taught software engineer, 24 years old, who had been contributing to a diversified portfolio monthly for several years, with the goal of achieving financial independence. Their strategy was straightforward: broad market exposure, automatic monthly transfers, reinvestment of gains, and maintaining the position without making further adjustments.

This approach worked well, allowing the portfolio to grow to six figures through consistent contributions and time, rather than through a single successful trade. However, once the user's income changed and contributions became uneven, the balance stopped serving as a reliable indicator of performance. The balance could now refer to multiple scenarios, each requiring a different interpretation: high contributions during a flat market, low contributions during a strong market, steady contributions with both positive and negative outcomes, or no contributions with positive results due to favorable circumstances.

This single number represented four different stories, making it impossible to distinguish between them. Frustrated by this ambiguity, the user began manually reconstructing the events based on available data and found several inconsistencies. Bug 1 revealed that the balance was essentially a materialized view, a snapshot of the current holdings and their value, without a detailed record of the events that led to this position.

This approach discarded most of the contextual information. The user's portfolio did not remain static; it evolved over time, with changes in spending habits, allocation toward dividend income, and a shift in investment focus. However, the data model only captured a simplified version of these dynamics, failing to provide a complete picture of the history.

Bug 2 highlighted another issue: the return calculation was not a single, unified function, but rather two different methods that yielded opposite results. The time-weighted return (TWR), published by funds and indices, ignored the timing of deposits and calculated the geometric mean of sub-period returns. This method provided a consistent percentage regardless of when money was added or withdrawn.

In contrast, the money-weighted return (XIRR) accounted for each cash flow, including deposits and withdrawals, and solved for the rate that equaled zero when discounted to present value. This method considered the actual timing of each transaction and provided a more accurate reflection of the investor's performance. The discrepancy between these two calculations illustrated the importance of understanding the underlying assumptions in financial metrics.

The user realized that the single figure on the broker's screen represented four distinct stories, each requiring a different response. By reconstructing the actual events, the user uncovered five bugs in the data model commonly used by most financial tracking tools. These bugs stemmed from a flawed data structure: positions were derived from events, but events were not derivable from positions.

To illustrate this, the user provided a simple example of a portfolio with deposits, holdings increases, withdrawals, and a final value. The time-weighted return calculated a positive gain, while the money-weighted return yielded a negative result, demonstrating that both methods could be correct depending on the context. The user concluded that the portfolio's return could be viewed from four different perspectives, and the broker's screen only presented one of these, omitting crucial context.

This realization led the user to advocate for a more transparent and detailed approach to financial tracking, emphasizing the importance of understanding the underlying events and calculations to make informed decisions.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Monday 31 August →