Skip to content
All case studies

Case study 02 · Fintech · Earnings & payouts

Earnings & payout engine for a US fintech rewards platform

A multi-level referral network, an earnings engine and ledger-style payouts — rolled out white-label for a Latin American distributor.

The problem

A rewards and referral platform pays members for referrals across several levels of the network they build. Every earning had to be calculated correctly, every payout had to be traceable, and the platform had to launch for new distributors under their own brand.

My role

I grew into leading the backend. I modelled the referral network, built the earnings engine, ledger-style transactions and payouts, and led the multi-tenant white-label rollout for a Latin American distributor — working directly with the client on technical design and coordinating the team's delivery.

Architecture

My scopeDecisions, explained below
Architecture diagram: Earnings & payout engine for a US fintech rewards platformWeb and mobile apps call a multi-tenant Django REST API backed by PostgreSQL, which holds the referral network and the ledger. The API hands heavy work to Celery workers, which calculate earnings, write ledger entries to PostgreSQL, and send payouts and notifications through external providers.Web & mobile appsmembers · adminsDjango REST APIDRF · multi-tenantPostgreSQLreferral network · ledgerPayout providers& notificationsCelery workersearnings · payouts · alertsasync tasksledger entriespayouts

Key decisions

  1. Money as a ledger, not a balance. Every earning and payout is recorded as a credit or debit entry and balances are derived from them, so every amount can be traced back to where it came from.

  2. Heavy work off the request path. Celery runs earnings calculation, payouts and notifications in the background, so API requests stay fast and predictable.

  3. A referral model built for multi-level earnings. The referral network is modelled in PostgreSQL so earnings can be calculated across several levels of a member's network.

  4. One platform, many brands. Multi-tenant white-label support let a Latin American distributor launch under its own brand on the same codebase.

Result

white-label launch for a Latin American distributor
Multi-tenant
every earning and payout recorded as a ledger entry
Traceable
grew from backend engineer to backend lead on the platform
Lead