Skip to content
Selected work

Case study 09 · Fintech · Company

Central credit ledger for multiple consumer apps

  • Software
Sector · client
Fintech · private company

01 — Context

Several of a company's apps needed in-app currencies (coins, points, tokens). Each would otherwise have built its own balance logic.

02 — Challenge

Balances had to be correct, auditable and isolated per app, with expiring credits, safe retries and no cross-app leakage.

03 — Approach

  1. Each app a registered client

    One ledger service where each app is a registered client authenticated with service credentials and owns its own credit types and reason codes.

  2. Lots, expiry and safe retries

    Credits are stored in lots with optional expiry. Debits use the soonest-expiring lots first, idempotency keys make retries safe, and a sweeper expires old lots.

  3. Units, not currencies

    Amounts are positive integers in each credit type's own unit. Money is handled upstream, so the ledger never converts currencies.

  4. Spec-first and tested for real

    Spec-first, with a spec-integrity check and integration tests against a real database in containers. It includes an admin front end.

04 — Outcome

The first consumer app passed its conformance suite against the live ledger in staging.

Have a meaningful problem? Tell us about it.

Request a project