Every payment system eventually meets the same quiet bug: a balance that is off by a fraction of a cent. The cause is rarely exotic. Floating-point arithmetic, silent rounding and inconsistent representation of money add up until a reconciliation that should be boring becomes an investigation.

Represent money exactly

The first decision is representation. Floating-point types are designed for measurement, not accounting; they cannot represent many decimal values exactly. Money in a ledger should be held in integer minor units with an explicit currency, so that addition and subtraction are exact by construction.

Concern Safer choice
stored amount integer minor units
currency explicit code on every entry
rounding defined at a single boundary
conversion recorded as its own entry

Round when, not where

Rounding is unavoidable once currencies convert or divide. The discipline is to decide where it happens and do it once. If several layers each round independently, their errors do not cancel — they compound. A multi-currency ledger should record a conversion as its own pair of entries, so that the original amount and the converted amount both remain visible.

Consistency across the perimeter

SUPA's ledger operates across roughly ten currencies, and internal FX takes place within the order book. Consistency is what allows balances in different currencies to be summed, netted and reconciled against partner statements without silent drift. Because balances sit with licensed partners before a banking licence, agreement between the ledger and the partner's records depends on both sides counting the same way.

A few habits keep it clean:

  • integer minor units, explicit currency, no floats in the ledger
  • one defined rounding boundary
  • conversions as their own attributable entries
  • reconciliation that compares exact values, not rounded aggregates

In short

  • Represent money as integers with an explicit currency.
  • Never let floating-point types hold balances.
  • Round once, at a defined boundary.
  • Record conversions as their own entries and reconcile exactly.

This is general information, not legal, tax or financial advice. Start from the developer surface: developers.