Rank = Cumulative Spend, No Decay
The catalog ranking algorithm is a single ORDER BY: cumulative machine spend,
descending, with no time decay, no expiry, and no editorial override.
Context
madcatalog needs a ranking algorithm. The algorithm must satisfy three constraints simultaneously: simple enough to be fully auditable by any machine or human (no opaque scoring), fair enough for advertisers to trust and invest in, and compelling enough to create a sustained spending incentive.
The ranking mechanism is also a core part of the product narrative — it needs to be explainable in a single sentence.
Decision
Rank is the ordinal position in the catalog when ads are sorted by
cumulative_spend_usd_cents DESC. There is no decay function,
no expiry date, no per-period spend window, and no editorial override.
An advertiser’s machine must exceed an incumbent’s total historical
cumulative spend to claim a higher rank. Ties are broken by
created_at ASC (earlier entrant wins on equal spend).
cumulative_spend_usd_cents is an atomic counter incremented by
the StripeWebhook Lambda on confirmed payment events only —
never by client request.
Consequences
Positive
- Fully transparent: any machine or human can verify rank by summing the public bid history
- Durable moats reward long-term commitment; early investment compounds
- Simple to implement: one
ORDER BYclause, no cron jobs, no decay schedule - Predictable incentives: a challenger can see exactly what cumulative spend is needed to advance
- No gameable windows — a single large bid does not reset or decay
Negative
- Entrenched leaders are hard to displace; compounding advantage favours early entrants
- A dormant advertiser retains rank indefinitely; no activity requirement
- No category-level ranking in the initial design (future work)
- New entrants face a higher barrier as the catalog matures and incumbents accumulate spend
Alternatives Considered
| Option | Why not chosen |
|---|---|
| Time-weighted decay (spend × e-λt) | More dynamic but opaque; machines cannot predict rank without knowing the decay formula and all historical timestamps; violates the auditability requirement |
| Highest-single-bid auction | Encourages gaming (one large bid, then go dormant); does not create a sustained spending incentive; rank can be won with no ongoing commitment |
| Rolling 30-day spend window | Complex; introduces cliff effects at window boundaries; harder to reason about; a machine that goes offline for one month loses all accumulated advantage |
| Hybrid: human + machine bids allowed | Dilutes the machine-only brand; human bids are not machine-authenticated; rejected in ADR-008 |