Reserve rule and headroom
The reserve rule is one inequality that must hold for each asset at all times:
supply_expected + inflight_reserved ≤ available_reserves
The terms:
supply_expectedis the supply the issuer believes is on chain. It changes only through confirmed mint and burn operations seen by the watcher.inflight_reservedis the sum of reservations for signed transactions that have neither been confirmed nor expired yet.available_reservesis the ledger's customer fiat balance plus the sum of every fresh reserve source value.
A reserve source is fresh while its value is younger than its maxAgeSeconds. An older value counts as zero, so stale data can only reduce headroom, never raise it.
Headroom is what's left: available_reserves − supply_expected − inflight_reserved. A mint may reserve only if its amount fits inside headroom.
How a mint reserves before it mints
requestMint(asset, amount) runs in one transaction:
- Lock the asset's reserve state row.
- Fail with
mints_pausedif minting is paused. - Compute the available reserves.
- Check
supply_expected + inflight_reserved + amount ≤ reserves; otherwise fail withinsufficient_reserve_headroom. - Record the reservation and add
amounttoinflight_reserved.
A reservation is tied to one signed envelope and its max_time. When the watcher confirms inclusion, the amount moves from inflight_reserved to supply_expected. When the envelope is confirmed expired, the reservation is released. Each happens exactly once, so a reservation can't be counted twice or lost.
When the rule breaks
Reconciliation runs every five minutes and on demand. It compares the ledger, the chain and the rails, and reacts:
| Check | On break |
|---|---|
On-chain supply against supply_expected | Stop the line: set mints_paused (Sev-1) |
supply_expected + inflight_reserved against reserves | Stop the line: set mints_paused (Sev-1) |
| Ledger customer fiat against the rail's balance | Warn, and track the difference as in-transit with an age |
| Reserve source freshness | Warn |
Resuming mints after a stop needs an operator, a written reason and an audit row.
Endpoints
GET /v1/public/reserves/{code}returns the signed reserve figure for an asset.GET /v1/public/supply/{code}returns the matching signed supply figure.GET /v1/assets/{code}shows the asset and its reserve configuration.POST /v1/transferscreates the mints this rule gates.GET /v1/accountsshows the ledger balances behindavailable_reserves.