Today in Edworking News we want to talk about wasteman.codes Engineering Principles for Building Financial Systems. Best practices and principles to create accurate and reliable software based financial systems. Accounting hasn't really changed in the past couple of hundred years. Despite this, there is a lot of confusion around the right way of building software for financial systems. In this post, I’ll share lessons from my years working on financial systems at big tech companies. Our focus will be building an accounting system, but the principles apply to more general financial systems as well.
---
Basic financial definitions
General Ledger (GL): The primary accounting record summarizing all financial transactions over a specific period. Think of it as an aggregation of sub-ledgers.
Sub-ledger: Contains detailed information about all individual transactions related to a specific GL, offering granular data such as specific customers or line items in an order.
Financial Record: This term refers to both the general ledger and sub-ledgers.
Material: A financial event considered significant enough to impact stakeholder decisions based on financial statements.
High-Level Data Flow Goals
The three main goals for an accounting system are to be Accurate, Auditable, and Timely.
Accurate
The financial record must reflect the known state of the business. For example, if selling 10 units of a product at $9.99, the financial record should show $99.90. However, simple summation or rounding errors in massive data sets can cause inaccuracies.

Image Description: Detailed financial transactions and their summaries.
Auditable
The financial record must be easily auditable, enabling stakeholders to detect errors and measure performance accurately. This is crucial for compliance, including IRS requirements.
Timely
An accounting system should meet the timely needs of your business. While smaller businesses might close books monthly, larger companies benefit from near real-time monitoring to make quicker financial decisions.
Engineering Principles
Three key engineering principles are vital for building financial systems: Immutability and Durability of Data, Granular Data Representation, and Idempotent Code.
Immutable and Durable
Data immutability enhances auditability, making debugging easier and retaining a historical state. Once data is recorded, it cannot be deleted; corrections are made through new transactions.
Data at the Smallest Grain
Recording data at the smallest grain enables a clear audit trail and makes it easier to debug issues. It also ensures precise corrections by rerunning data pipelines after fixing errors.
Idempotency
Financial events must be processed only once to avoid duplicate records, ensuring accuracy across financial records.
Best Practices
Several best practices help avoid common pitfalls:
- Use integers, not floats, to represent financial amounts to simplify arithmetic.
- Ensure granularity supports currency conversions with minimal precision loss.
- Use consistent rounding methodologies to prevent discrepancies.
- Delay currency conversion until after local aggregations to reduce precision loss.
- Consider using integers for time representations to avoid parsing inconsistencies across different libraries.

Image Description: The flow of recording and processing financial data, showing immutability and correction process.
Remember these 3 key ideas for your startup:
- Adopt Engineering Principles: Ensure your financial system is accurate, auditable, and timely by implementing principles such as immutability, granularity, and idempotency. This helps in understanding the financial health and compliance requirements better.
- Use Best Practices: Using integers over floats, standardizing rounding methods, and carefully handling currency conversions can drastically improve data accuracy. This minimizes discrepancies and ensures compliance with various financial regulations.
- Leverage Productivity Tools: Edworking is the best and smartest decision for SMEs and startups to be more productive. Edworking is a FREE superapp of productivity that includes all you need for work powered by AI in the same superapp, connecting Task Management, Docs, Chat, Videocall, and File Management. Save money today by not paying for Slack, Trello, Dropbox, Zoom, and Notion.
---
For further insights, subscribe to wasteman.codes’ newsletter and read more about accounting tailored towards software engineers.
For more details, see the original source.






