Proprietary trigonometric fraud detection, a 5-state maker-checker workflow, RBAC with 25+ permission categories, and an immutable audit trail — all enforced at the database layer, not the application layer.
Protect is the security and risk layer of LedgerFlow — enforced at the database level so it cannot be bypassed by any application, API call, or direct SQL injection.
security.system_audit — non-bypassable by any route.Most fraud detection is simple threshold-based alerting. LedgerFlow uses circular statistics to model behavioural patterns around the 24-hour clock.
Each account builds a 90-day statistical baseline across three dimensions: day-of-week (DOW), day-of-month (DOM), and hour-of-day. The algorithm converts time of day to a circular angle and uses sin, cos, and atan2d to compute the mean direction and concentration of that account's transaction activity.
When a new transaction arrives, the algorithm calculates how far the current moment is from the account's historical mean direction. Transactions that occur at times outside the account's normal pattern are flagged — even if the amount is within normal range.
Maker and checker roles are JWT-derived server-side at the PostgREST layer — no client-side manipulation can forge or swap them. Every state transition is recorded in the immutable audit log.