An open-source engineering project exploring precise money, verifiable ledgers and explicit decisions in TypeScript.
Selected work - 02 / Open source
Monetra& Monetra Core
Project overview
Monetra is a self-directed open-source project. It brings precise money values, financial calculations and verifiable ledgers into a TypeScript toolkit. Monetra Core provides the smaller money foundation for applications that do not need the full framework.
Technologies used
How the toolkit fits together
One precise value can support different kinds of work.
Amount & currency
A value enters with an explicit currency and precision.
Monetra Core
Immutable BigInt money values and explicit rounding.
Financial logic
Interest, loans, NPV and other calculations.
Bookkeeping & audit
Double-entry postings, trial balances and hash-chain verification.
( 01 ) - The premise
Money is not a number. It is a value with a currency, a precision and a history.
JavaScript’s default numeric model is convenient, but financial systems cannot accept floating-point drift, silent rounding or a cent disappearing during allocation. Monetra makes those constraints structural: correctness begins in the value object and continues through calculation, bookkeeping and audit. The project shows how I model domain rules, test edge cases and make decisions inspectable.
Exhibits - the premise
Two files · computed in this browser
Precision proof - live arithmetic
driftstrue
0.1 + 0.2 = 0.30000000000000004money(0.1) + money(0.2) = 0.30 · 30 minor units Explanation
The top line is this browser’s floating-point sum. The bottom line is the same operands through BigInt minor units - no binary float at any step.
Explanation
The same failure shows up when money is divided. Round each share with floating-point and a cent disappears. Allocate in minor units and the parts always recompose to the original.
Allocation - largest remainder
float.sumsfalse
split.sumstrue
IEEE 754 · toFixed(2)
- Person 0133.33
- Person 0233.33
- Person 0333.33
Monetra · split()
- Person 0133.34
- Person 0233.33
- Person 0333.33
Naive equal divide · requires RoundingMode
Explanation
Giving every person the same rounded share loses the remainder. split() redistributes those leftover minor units so the parts still compose the whole.
Each share33.33
× people99.99
Short0.01
( 02 ) - The ledger
The rules of a physical journal, made executable - and independently verifiable by anyone holding the book.
Append-only · SHA-256
isBalancedtrue
verify()true
Rewrite the debit on entry 02 from 1 200.00 to 1 000.00 - the kind of edit an ordinary mutable record would accept without comment.
Chain intact - every entry hashes to its stored digest
( 03 ) - Layers
Three layers share one definition of value - so modelling, calculation and audit never drift apart.
Precision
Immutable BigInt monetary values, ISO 4217 currencies, and explicit rounding - value never passes through floating-point arithmetic.
Financial Logic
Interest, loans, amortisation, NPV, IRR and depreciation compose on the same monetary primitives - one model from calculation to report.
Audit
Double-entry bookkeeping, trial balances and append-only ledgers with SHA-256 hash-chain verification - controls you can prove, not assert.
( 04 ) - The core
Monetra Core isolates the correctness primitives so precise money can stand alone.
Applications that need precise money without bookkeeping or financial modelling can depend on the smaller package. The split is an architecture call - what must be shared, what should stay small - so the foundation stays focused while the full framework builds richer behaviour on the same semantics.

