All systems

MailAdx

An exchange where money moves in three directions at once

An ad exchange carrying its own demand-side platform, direct-sold inventory and open real-time bidding — with every rupee reconciled across publishers, advertisers and the agencies sitting between them.

The problem

Most exchanges bill one side and settle the other later, by spreadsheet. That works until an event is replayed, a charge is disputed, or an agency claims commission on a campaign that was partly refunded. Then nobody can say what anyone is owed.

How it is put together

  1. 01

    A serving path and a control plane, separated the same way, with events moving between them over a stream rather than synchronous writes.

  2. 02

    A two-sided ledger: every charge and every credit is a row, and balances are derived from rows rather than held as a mutable number.

  3. 03

    An internal demand-side platform that bids into the same auction as external demand, so house campaigns win on merit rather than by bypassing the auction.

  4. 04

    Creative rendered on the server as an image, because the display surface cannot be trusted to run anything.

  5. 05

    Multi-context access control: one person can hold several roles across several organisations, and the token carries the active context rather than a single flat role.

The hard parts

Idempotency is the whole product

A replayed event must not double-charge. A refund must not orphan a commission. A claim must be written as a ledger row before anything acts on it, so a crash halfway through leaves a recoverable state rather than a silent discrepancy.

Commission is a third party to every transaction

An agency earns on spend that may later be partly reversed. Getting that right means commission cannot be computed at the moment of spend — it has to be derived from settled rows.

Test traffic looks exactly like real traffic

Without deliberate isolation, internal testing drowns the reporting. Test mode had to become a first-class dimension carried through every event, not a filter applied at the end.

Yours does not have to be television.

The shape repeats: real-time decisions, money that has to reconcile, and tenants who must never see each other's data. Tell me what you are building.

Get in touch