Skip to main content
All monetary values inside Haggles are stored as signed 64-bit integer micro-dollars (1 USD = 1,000,000 micros). Floating-point numbers (number for currency) are forbidden across the entire codebase.

Double-Entry Flow Across Account Kinds

The Ledger Account Kinds (SPEC.md § 6.2)

Global Conservation Invariant

Every ledger transaction is enforced by a PostgreSQL CONSTRAINT TRIGGER ... DEFERRABLE INITIALLY DEFERRED verifying SUM(debit) == SUM(credit) at commit time, and an hourly invariant check verifies: