Finance dashboard
The admin home at /admin - revenue per currency, stamped vendor cost, margin, whether usage pays for itself, and a ledger-integrity check.
/admin is the finance dashboard, behind the admin-role gate. GET /admin/dashboard aggregates the ledger on demand - no rollup table, no writes - caching each answer 60 seconds per instance.
- The tab needs
payment.enabledandpricing.credits.enabled. The route serves either way, so/adminstill opens by URL.
Panels
| Panel | Shows | Scope |
|---|---|---|
| KPI cards | Revenue per currency, vendor cost, margin, credits outstanding, new payers | Range; deltas only where both windows were measured |
| Usage drawn vs cost | Credits usage drew, valued in USD, against stamped vendor cost | Range; absent without credits |
| Money in vs out | One area per charted currency, plus the vendor-cost line | Range, by UTC day - month at 12 months |
| Cost by category / feature | Stamped cost per pricing lane, then per ledger feature tag | Range |
| Top spenders | The ten largest stamped spenders (users and orgs) | Range |
| Ledger integrity | Every balance against the rows behind it, plus debt | All-time |
- Ranges: 7, 30 or 90 days, or 12 months, rolling back from now in UTC.
- Credits outstanding sums positive balances only - debt is listed under integrity, never netted off.
Does usage pay for itself
The tile values the credits usage drew back through pricing.credits.creditsPerUsd, the scale costToCredits priced them with, and sets that USD against the range's stamped cost.
| Reading | Meaning |
|---|---|
| Usage pays for itself | Drawn value beats cost, and every usage debit is stamped |
| Costs more than it draws | Drawn value is below stamped cost - check markup and metering |
| Not proven | Drawn value is ahead, but cost is only partly measured |
| No usage | Nothing drawn, nothing stamped - never shown as a surplus |
Asymmetric on purpose: stamped cost is a floor, so a shortfall stands on partial data while a surplus does not.
Per-user economics
The Users tab asks the same per account, all-time. Sorting Profit ascending names anyone costing more than they pay - ordered server-side over every user, not just the page on screen.
| Column | Is |
|---|---|
| Used | Credits their usage debits drew |
| Cost | Vendor cost stamped on their rows, USD |
| Profit | Their USD revenue minus that cost |
- A row whose usage is not fully stamped is marked: its profit is a ceiling.
- Usage billed to an organization belongs to no user - the ledger never says who ran it.
- All three follow
pricing.credits.enabled, through onebilling_logsaggregate per page.
Cost comes from settlement stamps
Vendor cost is read from metadata.cost.usd. A row without the stamp is excluded - never estimated, never zero.
| Situation | What the page does |
|---|---|
| Nothing stamped yet | Cost panels show a notice; cost and margin show an em-dash |
| Range opens before the first stamp | Margin em-dash, no cost delta, cost line breaks there |
- "Cost tracking since
<date>" names the first stamped row. Stamp your settlements to count them. - Categories are pricing lanes, not vendor products. A new lane shows its raw token until translated.
No currency conversion
- Revenue is reported per currency charged, one line each, never summed.
- Vendor cost is always USD, whatever your base currency.
- Margin and per-user profit count USD revenue only - other currencies are left out, never converted.
Ledger integrity
Every balance mutation writes its row in the same transaction, so a balance must equal what its rows record.
| Reading | Meaning |
|---|---|
| Balanced | Every balance agrees with the rows behind it |
| Unexplained credits | A write bypassed the ledger (a bug), or a balance moved out of band (abuse) |
| Debt | A negative balance a reversal explains - money owed to you, not a failure |
- Each mismatch links to
/admin/billing-logs?entityId=<id>- the rows behind that balance. - Covers users, the only entities holding one, ten largest per finding.
Accounts predating this release report as mismatches for their unlogged signup grant. Nothing is backfilled - inventing rows would forge the record this panel checks.