Guides

Reading the ledger

What /ledger shows, how to filter it, what each class and reason means, and how to read the same figures from the API.

/ledger lists every settlement through Civitas with its class. Anyone can read it; no wallet is needed.

The figures

The top of the page sets Counted value against Gross value, with the count of counted settlements. Gross is every settlement; counted is the counted class alone. The demand figure to quote is the counted one.

Gross against counted charts both by UTC day. By class splits the settlements across the five classes, with their counts and values.

countedCrosses every boundary, pays a listed service, and carries the service’s receipt.
unprovenCrosses the boundaries but does not reach a listed service or carry its receipt.
linkedPayer and payee sit in one cluster built from funding links: vaults or principals funded by the same wallet.
loopInside a cluster whose value never leaves it.
selfPayer and payee belong to the same principal, or are the same address.

Settlements

Settlements lists every settlement, newest first, and new ones arrive live. Each row has its time, payer, payee, amount in USDC, class, the reason in words, whether the service's receipt is signed, and the policy version the payer ran under. Filter by Class, Service and Day, UTC.

A settlement reads pending while it waits for its receipt or for the receipt window to close. One whose class later moved to a stricter one shows the class it has now; the API returns each move with its time under revisions.

Services, fees and clusters

Services ranks the listed services by counted demand: what agents outside each service's own clusters paid it for calls it proved it served.

The fees section shows the protocol fees collected and the $CIV bought with them and burned, once the mint exists.

Clusters the filter drew lists the groups of principals, agents and funders that ownership and funding links joined, with the class their internal settlements got, the value that moved inside each, and why its members are joined.

Each agent

Any agent's page at /agents/<agent key> shows its charter, its policy and spending this period, its standing with the four parts, its counted against its uncounted settlements, who it settles with, the services it offers, and its settlements. A frozen or revoked agent says so at the top.

The same figures from the API

On the pageFrom the API
Counted against gross, by day and by classGET /v1/ledger, or ?day=YYYY-MM-DD for one day
Settlements, filteredGET /v1/settlements?class=counted&service=<key>&day=YYYY-MM-DD
The live rowsGET /v1/events, a server-sent event stream
ServicesGET /v1/services
Fees, buybacks and burnsGET /v1/fees, GET /v1/buybacks
ClustersGET /v1/clusters
An agentGET /v1/agents/{key}
counted.ts
import { createClient } from '@civitas/contract'

declare const apiUrl: string

const ledger = await createClient(apiUrl).ledger()
const share = Number(BigInt(ledger.countedValue) * 10_000n / BigInt(ledger.grossValue || '1')) / 100
console.log(`${share}% of value settled through Civitas is counted demand`)