GenerateSaaS

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.enabled and pricing.credits.enabled. The route serves either way, so /admin still opens by URL.

Panels

PanelShowsScope
KPI cardsRevenue per currency, vendor cost, margin, credits outstanding, new payersRange; deltas only where both windows were measured
Usage drawn vs costCredits usage drew, valued in USD, against stamped vendor costRange; absent without credits
Money in vs outOne area per charted currency, plus the vendor-cost lineRange, by UTC day - month at 12 months
Cost by category / featureStamped cost per pricing lane, then per ledger feature tagRange
Top spendersThe ten largest stamped spenders (users and orgs)Range
Ledger integrityEvery balance against the rows behind it, plus debtAll-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.

ReadingMeaning
Usage pays for itselfDrawn value beats cost, and every usage debit is stamped
Costs more than it drawsDrawn value is below stamped cost - check markup and metering
Not provenDrawn value is ahead, but cost is only partly measured
No usageNothing 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.

ColumnIs
UsedCredits their usage debits drew
CostVendor cost stamped on their rows, USD
ProfitTheir 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 one billing_logs aggregate 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.

SituationWhat the page does
Nothing stamped yetCost panels show a notice; cost and margin show an em-dash
Range opens before the first stampMargin 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.

ReadingMeaning
BalancedEvery balance agrees with the rows behind it
Unexplained creditsA write bypassed the ledger (a bug), or a balance moved out of band (abuse)
DebtA 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.

On this page