# HTTP — `GET /v1/liabilities`

`GET /v1/liabilities` returns what Mosaiq owes its clients, read in one
snapshot of the ledger. It is the liabilities side of the proof of reserves.
To get the coverage, divide the reserves, which public sources show, by
`totalUsdc`. The endpoint is public and takes no parameters.

```http
GET /v1/liabilities
```

```jsonc
{
  "status": "ok",
  "data": {
    "asOfMs": 1791968092623,
    "totalUsdc": "35300",
    "clientEquityUsdc": "21800",
    "pendingWithdrawalsUsdc": "1500",
    "reviewRequiredDepositsUsdc": "12000",
    "clients": 4
  },
  "server_time_ms": 1791968095012
}
```

| Field | Meaning |
| --- | --- |
| `asOfMs` | When the server read the ledger, in Unix milliseconds. The figure is `server_time_ms - asOfMs` old. |
| `totalUsdc` | `clientEquityUsdc + pendingWithdrawalsUsdc + reviewRequiredDepositsUsdc`. `null` while a client position has no fresh price. |
| `clientEquityUsdc` | The sum over client accounts of `max(0, totalCashUsdc + unrealizedPnl)`, with the values of [`clearinghouseState`](/api/clearinghouse-state). Cash is net of pending withdrawals. Each position uses the oracle price of its own venue. `null` while a client position has no fresh price. |
| `pendingWithdrawalsUsdc` | Accepted withdrawals that Mosaiq has not paid yet. |
| `reviewRequiredDepositsUsdc` | USDC that a client sent to the treasury and that waits for an operator review before Mosaiq credits it. |
| `clients` | Client accounts owed more than zero, plus every account with a position that has no fresh price. |

Client accounts are all accounts except the Mosaiq fee and House accounts. An
account with a loss larger than its cash counts as zero. It does not reduce
what Mosaiq owes the other accounts.

Decimals are strings rounded to 6 decimal places. `totalUsdc` equals the sum of
the three rounded parts exactly.

## A figure at most 5 minutes old

The server keeps the figure in memory. While the ledger answers, the server
reads it at most once per minute, whatever the number of requests. A request
that finds a figure older than 60 seconds gets that figure and starts a new
read. When no figure is younger than 5 minutes, a request waits for a new
read. If that read fails, the endpoint returns HTTP `503` with code
`liabilities_unavailable`. Show the figure as unavailable, never as zero.

```json
{
  "status": "error",
  "data": {
    "code": "liabilities_unavailable",
    "msg": "client liabilities are unavailable; retry later"
  },
  "server_time_ms": 1791968095012
}
```

## Where the figure and the reserves differ

The figure and the public reserves differ in four cases:

* A transfer to the treasury that names no Mosaiq account is not a liability.
* Funding for past hours that the ledger has not booked yet is not in
  `clientEquityUsdc`.
* A withdrawal paid on-chain stays in `pendingWithdrawalsUsdc` until an
  operator completes it.
* A deposit is in the reserves from its transfer, and in the liabilities only
  from its credit or its review.

Requests count toward the shared HTTP limit of
[600 per minute per IP](/api/http-public#rate-limits).
