Financial systems

Fund-accounting terminal

A working fund-accounting system: four generations of command-line tool evolved into a web terminal sharing one ledger, with NAV unitisation, decimal-exact money handling and a benchmark overlay.

Active · July 2025 – present · the longest-running build here

  • 4generations, one shared ledger
  • Jul 2025running since
  • exactdecimal money, written as text
  • 0fund figures published anywhere

The build

When several people put money into one pot, you need to track who owns what share as money goes in and out at different times. The standard answer is unitization: the fund's value is divided into units, like shares in a fund. Put money in and you are issued units at today's price; take money out and units are redeemed at today's price. Everything else exists to keep that arithmetic exactly right.

Two decisions do most of the work. Money is never stored as an ordinary decimal number, because those cannot represent amounts like 0.10 exactly and the error compounds silently over thousands of operations; it is stored in a form that is exact and written to disk as text so nothing is lost in translation. And the older command-line tool and the newer web interface read and write the same files, so the two can never disagree about what the ledger says.

No figures from the fund appear anywhere on this site — no value, no returns, no members, no positions — and the repository is not linked.

Unitisation, and the ledger invariant Money paid in is converted to units at today's price per unit. The fund's value always equals its cash plus the market value of its positions. a member depositsmoney in€ deposit net asset value per unit, computed at the moment of the depositprice per unitvalue ÷ units the member is issued units at that priceunits issueddeposit ÷ price fund value = cash + Σ (position market value) checked on every write — the ledger cannot drift money is held as exact decimals and written as text, so nothing rounds withdrawals redeem units at the price of the day, by the same arithmetic
What you're looking at: what happens when someone puts money in. The deposit is divided by the current price per unit to decide how many units they receive, and the invariant along the bottom is checked on every write, so the ledger cannot drift. System design · no fund values, holdings or members are shown
The technical version

A NAV-based accounting system with per-member units, ownership, return and full transaction history across five screens. Four generations of command-line tool preceded the web application.

Correctness is the story

Money is handled as Decimal end to end and serialised to JSON as strings, so no float drift can enter the ledger. The core invariant, that fund value equals cash plus the market value of positions, is enforced rather than assumed. Deposits and withdrawals issue or redeem units at the current NAV. The web terminal and the command-line tool read and write the same state files, so the ledger cannot fork between them.

Flask, pandas and yfinance on the backend; React, Vite and Recharts on the front end.