Skip to content
The Cap Room

NBA salary cap · 2023 CBA · 2026-27 league year

The trade machine that shows its work.

A front-office console for NBA roster construction. A pure TypeScript rules engine checks every proposed trade against salary matching, both aprons, hard-cap triggers, cash limits, roster bounds and the Stepien rule, then explains the verdict with the arithmetic.

engine tests
44engine testsgolden CBA scenarios, run in CI on every push to main
rosters reconciled
9/9rosters reconciledeach re-sums to its published total, to the dollar
salary on the board
$1.82Bsalary on the boardevery contract traced to a dated public source
qualified players
379qualified playersthe pool behind every league percentile

The league board

2026-27 team salary against the five lines. August is when contenders duck the second apron.

◆ SAC $201.5M · $1.1M over the tax

2026-27 team salary for 9 seeded teams against the salary floor, cap, luxury tax and both aprons. Each team links to its cap sheet.

⌇ scale $130.0M to $235.0M · ◆ SAC is the home desk · tap a team for its cap sheet · data as of 2026-08-04

60 seconds

Three trades to try

Three modules

One rules engine underneath

Under the hood

How it's built

The engine is the product

/engine is pure TypeScript: no React, no Next.js, no I/O. Each CBA rule is a function you can audit in one sitting, and boundaries are tested to the dollar ($209,015,000 is not over the first apron; $209,015,001 is).

engine/tradeRules.ts

Data that can't drift

Rosters are Zod-validated JSON snapshots with a source and access date. A pre-build gate re-sums every team through the engine and fails the deploy if a single dollar disagrees with the published total.

scripts/validate-data.ts

It runs on its own API

The UI reads the same REST routes you can curl. POST /api/trade/validate takes a proposal and returns the full ledger, so the trade logic is reusable outside this interface.

app/api/
  • Next.js 16
  • React 19
  • TypeScript strict
  • Zod
  • Vitest
  • Tailwind CSS
  • Python ETL
  • GitHub Actions
  • Vercel