C1 and C2
Ledger and Accounts
A ledger that argues back. Most core systems treat double-entry as a convention the application layer agrees to follow. Here it is a constraint the database enforces, which is the difference between a book that is usually right and a book that cannot be wrong in that particular way.
Posting, and refusing to post.
A transfer moves the money and prices it in the same transaction, so the wallet debit, the settlement credit and both sides of the fee post together or not at all. Remove one and the set no longer sums to zero.
What happens then is the point. There is no partial write, no compensating entry queued for the morning, and nothing for an operator to find and reverse. The transaction is simply refused.
| Account | Side | Amount |
|---|---|---|
Client wallet, Northwind Trading | Debit | -24,500.00EUR |
Settlement, safeguarded | Credit | 24,500.00EUR |
Client wallet, Northwind Trading | Debit | -12.50EUR |
Fee income | Credit | 12.50EUR |
ledger.trial_balance_zero rejects the transaction before it commits. There is no partial write to clean up.The tables underneath.
Four of the twenty-nine, and the four an integrator meets first.
Four invariants, checked rather than asserted.
Each is a named check that runs against the live book. An invariant nobody runs is a comment.
Entries for a transaction sum to zero, per currency
A deferred constraint checked at commit, so a transaction that does not balance never lands.
A balance equals the replay of its entries
Checked continuously by ledger.balances_match_replay rather than trusted.
No client position goes negative without an authorised facility
ledger.no_negative_client_positions, run against the live book.
A written record is never updated
The evidence tables have no update path. The database rejects the statement.
M1 and M4Orchestration and rails
The same entry, whoever triggered it.
The ledger does not know or care whether an officer booked the movement by hand or a rail webhook did. That is what makes going live before an integration a sequencing decision rather than a rewrite.
manual_bookingprovider_eventIdentical entry, either way
See it against your own chart of accounts.
Bring the transaction types you actually run and we will post them, including the ones you expect to break it.