Build loan ledgers that stay consistent through payment reversals, backdated entries, and out-of-order events — guaranteed by the engine, not by careful coding.
Java 21 · Quarkus / Spring compatible · JavaMoney 256-bit precision · 53 tested invariants
// the_problem
// capabilities
Backdated activities automatically trigger ledger rollback to the effective date, deterministic re-application of all subsequent activities, and delta-based synchronisation back into the primary ledger.
Every reversal emits a signed compensation entry that mathematically negates the original impact, then rolls back and replays all downstream activities so running balances stay consistent.
Every LedgerEntry carries both the component deltas (Δprincipal, Δinterest, Δfee, Δexcess) and the running balance — always consistent, always auditable.
Built on Moneta with a 256-bit HALF_EVEN MathContext. No IEEE-754 floating point drift — every cent is accounted for across millions of entries.
Composite idempotency keys on every entry prevent double-application on retry storms or duplicate event delivery — critical for event-sourced architectures.
Ship with ComputationalSpread (interest-first waterfall) and StaticAllocation. Implement TransactionSpreadStrategy for any custom allocation rule.
// how_it_works
Transaction, SOD accrual, or reversal submitted via API
Engine checks if back-dated, reversal, or chronological
Fork, recompute, and reconcile deltas back into primary ledger
// Pseudocode — the actual engine branching logic
for each activity in pendingActivities:
if activity.isBackdated(ledger):
retroLedger = ledger.rollbackTo(activity.effectiveAt)
retroLedger.apply(activity)
replaySubsequent(retroLedger, activitiesAfter)
ledger.syncWith(retroLedger) // delta reconciliation
else if activity.isReversal():
ledger.addCompensation(negate(originalImpact))
retroLedger = ledger.rollbackBefore(originalActivity)
replaySubsequent(retroLedger, activitiesAfter)
ledger.syncWith(retroLedger) // delta reconciliation
else:
activity.applyTo(ledger) // chronological — fast path
// integration
<!-- Add to your pom.xml -->
<dependency>
<groupId>io.github.v1bh0r</groupId>
<artifactId>precise-ledger-pro</artifactId>
<version>1.0.0</version>
</dependency>
// Apply activities — engine handles backdated & reversals
var ledger = ledgerService.getLedger(loanId);
var clock = ledgerService.getCurrentLedgerClock(ledger);
ledgerService.applyLedgerActivity(
ledger, activity, clock, temporalContext
);
// That's it. Balances are correct.
var balance = ledger.getCurrentBalance();
// → Balance[principal=USD 991,000.00, interest=...]
// pricing
One price, deploy anywhere. Every plan includes a perpetual usage license, the 53-test acceptance suite, and your first year of updates & support.
+ $499 / year for support renewal
+ $1,999 / year for support renewal
// faq
Ledger, LedgerService, activity types) is framework-agnostic. It works with any JPA/Hibernate environment including Spring Boot, Micronaut, or plain Java SE.
See the rollback-replay-sync engine handle reversals and backdated payments in real time, then talk to us about licensing.