Skip to content
SeerDocsWebsite
Browse documentation

Developer documentation API v1

SCC balances and service metering

Exact monetary representation, atomic commitments and attributable charges.

Reserve, charge and release

Starting from 150 SCC, 20 is reserved, 12 charged and 8 released, leaving 138 available and none committed.
Worked service charge. Reservation changes availability; consumption reduces outstanding value; release restores the unused commitment. View full size ↗

Balance representation

The SCC API represents value as integer atoms with an explicit scale. At scale 2, 100 atoms equal 1 SCC. This balance contains 150 SCC outstanding: 130 available and 20 committed. API serialization scale and the decimals of an external token contract are separate properties.

json
{
  "asset": "SCC",
  "scale": 2,
  "available_atoms": "13000",
  "committed_atoms": "2000",
  "outstanding_atoms": "15000",
  "revision": 7
}

Balance invariants

O denotes outstanding SCC, A available SCC and C committed SCC. Outstanding is the current unconsumed credit balance, not cumulative lifetime issuance. A reservation changes availability without changing outstanding value. Consumption reduces the outstanding balance. Each reservation carries an identity, state and revision, with atomic duplicate protection.

O=A+C,A≥0,C≥0reserve⁡(x):(A,C)↦(A−x,C+x),0≤x≤Aconsume⁡(x):(A,C)↦(A,C−x),0≤x≤Crelease⁡(x):(A,C)↦(A+x,C−x),0≤x≤C\begin{aligned}O&=A+C,&A&\ge0,&C&\ge0\\ \operatorname{reserve}(x)&:(A,C)\mapsto(A-x,C+x),&0&\le x\le A\\ \operatorname{consume}(x)&:(A,C)\mapsto(A,C-x),&0&\le x\le C\\ \operatorname{release}(x)&:(A,C)\mapsto(A+x,C-x),&0&\le x\le C\end{aligned}

Runnable exact-money reservation

This function isolates the balance transformation. The ledger applies it within an atomic transaction that checks the balance revision and reservation identity.

python
def reserve(available_atoms, committed_atoms, amount_atoms):
    values = (available_atoms, committed_atoms, amount_atoms)
    if any(type(v) is not int or v < 0 for v in values):
        raise ValueError("Expected nonnegative integer atoms")
    if amount_atoms > available_atoms:
        raise ValueError("Insufficient available balance")
    return available_atoms - amount_atoms, committed_atoms + amount_atoms

assert reserve(15000, 0, 2000) == (13000, 2000)

Metering and entitlement

Each metered operation pins a service-rate revision and billable quantity definition. Admission can reserve a bounded amount; completion posts the charge and releases the unused commitment according to that rate policy. Partial results, cancellation and dependency failure retain their classified billing outcomes.

Entitlements determine service access, budgets limit consumption, and the SCC ledger records value. Financial mandates independently authorize purchases and withdrawals. The same balance can fund several services without collapsing these controls into one permission.

Exactly one economic posting per charge

A stable usage identity associates the service, agent, task, rate revision and billable quantity with one journal charge. Duplicate deliveries resolve to the existing posting. Unknown usage remains unresolved under its reservation policy rather than being interpreted as zero cost.

The uniqueness guarantee concerns the economic posting, not the number of messages or computation attempts. Multiple delivery attempts can therefore converge on one attributable charge.

Partial-charge ledger trace

All amounts are SCC. The usage charge and reservation have stable identities, so repeated completion events resolve to the same postings.

TransitionAvailableCommittedOutstanding
Initial balance1500150
Reserve 2013020150
Consume 121308138
Release unused 81380138

Atomicity under competing reservations

Two requests can observe the same available amount before either commits. The ledger evaluates the reservation against the current balance revision inside the atomic write, so only a request whose predicate still holds can advance it. A stale request is reevaluated rather than subtracting against an outdated value.

The invariant concerns the authoritative balance. Cached UI values and activity projections can lag without creating additional spending capacity. Reservation identity also distinguishes releasing unused commitment from crediting a second refund.

SeerTechnical reference · 1 November 2026