# Solvency as one inequality: backing minus owed

> Canonical: https://blazephoenix.xyz/learn/solvency-as-one-inequality/
> License: CC BY-NC-ND 4.0 (attribution + link) · © 2026 BlazePhoenix
> Updated: 2026-11-16

Anyone can check that the staking contract holds what it owes by calling four view functions and comparing two numbers: backing() is the BZPX it holds, owed() is every claim on it, and it is solvent when backing() + dust >= owed(), with dust fixed at 1e10 wei. The engine is pre-launch, so this is a procedure to run once the contract exists.

Short answer: call four view functions and compare two numbers. `backing()` is the BZPX the contract physically holds. `owed()` is every claim on it, recorded bad debt included and never netted against anything. The contract is solvent when `backing() + dust >= owed()`, with the dust fixed at `CONSERVATION_DUST` = 1e10 wei. That one inequality is `isSolvent()`.

The point of the design is that a reader does not have to trust a dashboard. The staking engine is pre-launch, so this is a procedure to run once the contract exists, not a reading anyone can take today.

## Four functions, in increasing detail

`owed()` and `backing()` give the two sides. `isSolvent()` is exactly `!_hardBreach()`, the same condition that lets anyone trip the circuit breaker: `isSolvent()` is false exactly when `tripBreaker` would succeed outside an emergency. `solvency()` returns a report with a collateralisation ratio in WAD, `backing * 1e18 / owed` floored, where 1e18 means exactly covered. That ratio is published by a single producer, and `solvency()` reports that reading rather than a second copy of it (the rule in the article on one question and one producer).

## The five bits of auditInvariants

`auditInvariants()` returns a bitmask with one bit per check. Zero means every check holds. Only bit 0 gates the breaker. Bit 1 is a signal, not a guard, because a position can be briefly unhealthy before a liquidation closes it.

## Where the inequality is enforced

The modifier `conserves` wraps every value-moving transaction. It compares the change on the two sides of the master identity, balance + total debt + total bad debt + stakedOverdraw on one side, total staked + reward reserve + protocol reserve + pending distribution on the other, within dust, and reverts if the transaction leaks value. The identity is checked on the change across the call, so rounding drift from the past cancels and only a transaction that itself leaks value fails. `emergencyWithdraw` and `syncEquity` sit outside the modifier so they stay callable in a breach. The identity itself is the subject of the article on the master conservation identity.

Two tests keep the inequality honest between releases: `invariant_solvent` and `invariant_backingCoversOwed`, stateful invariants that run a randomised sequence of calls and then check the inequality.

## How to read a true

A view that returns true means solvent on what has been recorded. A loss that has not yet been written down, such as a borrower whose accrued debt has passed the stake, is read in part until a sweep, a liquidation or the borrower's own emergency exit records it. The paper says so in section 25.10, and the repository documents the same reading. Reading `owed()` therefore as a lower bound until the next sweep is the careful way to read it.

## What this does not claim

It does not say a shortfall cannot happen: it says how a shortfall is made visible and what the contract does about it. It publishes no reading, because there is no deployed contract to read yet. And it takes nothing from our servers: the four values and the block number are all you need.

**Verify it yourself:** Before launch, run the stateful tests invariant_solvent and invariant_backingCoversOwed in BlazePhoenixStaking.t.sol (and the same check in InvariantsFullSurface.t.sol) at commit c0366cf of the staking repository. After launch, call owed(), backing(), isSolvent() and auditInvariants() at a block of your choice and compare backing() + 1e10 with owed(). Reading: section 25.10 of the 2.4 whitepaper.

Related: https://blazephoenix.xyz/learn/proof-of-solvency/ · https://blazephoenix.xyz/learn/master-conservation-identity/ · https://blazephoenix.xyz/learn/one-question-one-producer/
