Themis
Financial transaction processor that applies deposits, withdrawals, disputes, and chargebacks to client accounts from CSV streams.
Overview
A Rust transaction processor focused on precision, domain modeling, and correctness for disputed financial event streams.
Problem
Financial systems are unforgiving: precision mistakes, invalid state transitions, or ad hoc business rules can all create subtle correctness failures. This kind of workflow benefits from types that encode invariants directly.
Approach
Themis ingests CSV transaction events and applies deposits, withdrawals, disputes, resolves, and chargebacks to client accounts. It keeps floating-point handling at the CSV boundary, stores values as scaled integers, and uses domain-specific types to represent money safely inside the core system.
Engineering Decisions
The most important design choices behind the project and why they matter.
Encoded monetary precision in the domain model
Amounts are represented as scaled integers so precision is preserved internally instead of depending on floating-point behavior.
Separated non-negative amounts from signed funds
Different money types capture different invariants, which keeps the code honest about where negative balances can and cannot exist.
Enforced locked-account behavior structurally
Once an account is locked, further operations are rejected as part of the model rather than scattered conditional checks.