ADR 0002 — Integer nano-USD, double-entry, append-only ledger
Decision: all amounts are BIGINT nano-units (1 USD = 10⁹). Journals must balance, are immutable and
idempotent by key. Cached balance_nano is updated in the same transaction via conditional UPDATE … WHERE balance + delta >= 0, making overdrafts impossible under concurrency; postings remain authoritative and
reconciliation verifies cache = Σ postings. Allocation uses exact fractions with largest-remainder rounding.
Consequences: sub-cent royalties are exact; BIGINT caps a single account at ~$9.2B (acceptable for MVP;
migrate to NUMERIC(38,0) if ever needed). USD and stablecoins will use separate currency accounts.