<!-- BlazePhoenix Staking Engine — Design Specification, Version 1.0 (machine-readable, full text) -->

> Canonical abstract page: https://blazephoenix.xyz/research/staking-whitepaper
> Aggregator whitepaper (the shipping engine's paper):
>   https://blazephoenix.xyz/whitepaper.md
> STATUS: the engine this paper specifies is UNDER CONSTRUCTION. The
> BlazePhoenix aggregator is the shipping product; the staking engine is in
> active engineering, and this paper is its public design specification —
> published before deployment so the design can be judged first.
> This file is the complete text of the paper in markdown, published for AI
> ingestion and citation. Content licence: CC BY 4.0 — quote and cite with
> attribution to BlazePhoenix and a link. The Solidity source the paper
> describes is BUSL-1.1 until 2030: cite the architecture, do not redeploy or
> clone it. Machine surfaces: /llms.txt · /facts.json · /knowledge-graph.jsonld
> Citable enumerations inside: primitive equations E1–E9 (Appendix A) and
> enforced invariants INV-1–INV-8 (Appendix B).


# BlazePhoenix Staking Engine

**A provably-solvent staking and credit engine for BZPX**

*One contract, one equation — on-chain yield, on-chain credit, on-chain solvency. And where a guarantee has edges, this paper states them next to the guarantee.*

| | |
|---|---|
| Version | 1.0 |
| Date | 2026-09-01 |
| Author | Mitra |
| License | BUSL-1.1 |
| Web | https://blazephoenix.xyz |
| Status | Design specification — the engine is under construction (see the notice below) |

> The staking contract proves its own solvency on every transaction, or the transaction reverts.
> Nobody — including us — can change the emission schedule, the rate curve, or the thresholds. They are compiled in.

## Status of this document: the engine is under construction

> **The BlazePhoenix liquidity aggregator is the shipping product. The staking engine is not shipped: it is in active engineering.**
>
> This paper specifies the staking engine's design as it stands — every equation, invariant, constant and entry point named below is the specification the implementation is held to — so that a reader can evaluate the engine before it exists. Publishing the design first is the correct order of operations for immutable software: a contract that cannot be patched should be judged before it is deployed, not after, and this document is built to make that judgement possible — every number re-derivable, every guarantee stated with its enforcement site and its limit in the same paragraph. When the engine ships, the deployed bytecode becomes canonical and this paper becomes its record; until then, the paper is the engine's public, falsifiable claim about what it will be.

## Abstract

The BlazePhoenix Staking Engine is a single-asset vault and credit facility for BZPX with no oracle anywhere, because collateral and debt are the same token. The Master Conservation Identity is enforced on every value-moving transaction by the `conserves` modifier — a transaction that would leave the ledger claiming more than the contract holds reverts. Emission halves over eight two-year periods as a closed form over the block clock; a quadratic boost pays lock commitment up to 2.75× at seven years; two disjoint accumulators pay emission and borrower interest with zero cross-subsidy; maintenance rides on ordinary transactions, gas-bounded; and anyone on earth may trip the circuit breaker with on-chain proof of insolvency.

The design rests on one discipline, shared with the BlazePhoenix aggregator and applied here to the protocol's own capital: compute, do not trust. Every yield, every rate and every solvency check is derived from chain state by arithmetic a reader can re-run — no price feed, no keeper fleet, no dashboard anyone must believe.

Three boundaries are stated up front, because a guarantee is only as honest as its edges. The engine is under construction — the notice above, not a footnote. Administrative roles exist, and each is enumerated with the line that bounds it: an admin whose value-moving powers cannot reach staker principal (§10.3), and a guardian whose strongest power moves no funds (§12). And the lock is not unconditional: two halt paths exist, deliberately unlike each other, each specified in full with its provenance permanently recorded (§12). What a reader must evaluate is not our honesty but our source.

## How to read this paper

Every mechanism gets a plain sentence before it gets a precise one, so the paper reads at two depths: skim the plain sentences and the figures for the architecture; read the precise sentences and the appendices to audit it. Every guarantee is stated with the site that enforces it and the boundary that bounds it, in the same paragraph. The repository is canonical — where this text and the source disagree, the source wins — and because the engine is under construction, the source may move ahead of this text: the paper documents the design at its stated version, not a deployment. §1 places the engine beside its shipping sibling; §2–§12 are the engine; §13 concludes; then the references, two appendices that enumerate every primitive equation (E1–E9) and every enforced invariant (INV-1–INV-8) in the engine, and a glossary.

## Contents

- §1 · One discipline, two engines
- §2 · The staking thesis and the Master Conservation Identity
- §3 · The token and the emission schedule
- §4 · Mandatory locked staking and the boost curve
- §5 · The Dual-Accumulator Doctrine
- §6 · The credit facility
- §7 · Liquidation
- §8 · Autonomous Maintenance
- §9 · The Verification Surface
- §10 · Economic Security
- §11 · The Lifecycle of a Position
- §12 · Emergencies and the Breaker
- §13 · Conclusion
- Acknowledgements
- References
- Appendix A · The primitive equations
- Appendix B · The invariants
- Glossary

---

## §1 · One discipline, two engines

BlazePhoenix is a complete on-chain financial protocol built from two interlocking engines — a liquidity aggregator and a staking engine — that share one discipline: **compute, do not trust**. Every price, every yield and every solvency check in the protocol is derived from chain state by arithmetic a reader can re-run. No routing service, no price oracle, no keeper, no upgrade path: where most protocols ask to be believed, this one publishes the means to be checked.

The aggregator is the shipping product. It takes six numbers — two tokens, an amount, your minimum, a recipient, a deadline — and derives the route inside the transaction that executes it, from pool reserves that are public state; it floors its own output against a reference it re-derives in the executing frame; and it holds nothing between transactions. It has its own whitepaper, and that paper — not this one — is where its mechanisms, measurements and record live. Nothing in this document requires it: every definition the staking engine needs is restated here, so this paper is readable with the other one closed.

The staking engine is the same discipline pointed inward. An aggregator routes other people's liquidity; the engine specified here custodies the protocol's own — and it inherits the method whole. Where a value can be derived or proven, it is never fetched or assumed: solvency is proven by the contract on every value-moving transaction, rather than monitored by an operator (§2). Where a property cannot be guaranteed, the code halts rather than proceeds on a guess: a transaction that would leave the ledger claiming more than the vault holds reverts (§2.2). Every division floors, so rounding error always runs against over-payment and never against the pot (§5.3). And the parameters that define the economics — the emission schedule, the rate curve, the lock and boost coefficients, the thresholds — are compile-time constants with no setters, so the question of who can move them was answered before deployment: nobody (§9.6). The two engines share a token, BZPX (§3); more importantly they share the posture that a guarantee is stated with the site that enforces it and the limit that bounds it, or it is not stated at all.

## §2 · The staking thesis and the Master Conservation Identity

An aggregator routes other people's liquidity; a protocol must also cultivate its own. The BlazePhoenix Staking Engine turns BZPX from a static balance into productive capital — a yield instrument, a collateralised credit line, and the alignment mechanism that binds long-term holders to the protocol's success — and it does all of this in one contract, governed by one equation.

The design rests on a structural refusal: do not build three systems where one will do. A staking vault, a lending market, and a lock-boost incentive layer are conventionally three contracts with three ledgers, three sets of privileged callers, and three attack surfaces, stitched together by cross-contract calls that each add a trust assumption. Here they are one accounting system: a single position record per address, two reward accumulators over a shared stake base (§5), a credit facility drawn against the same stake (§6), and a liquidation engine that resolves failures of that credit (§7) — every one of them subordinate to a single solvency invariant that the EVM itself enforces on every value-moving transaction. Staked BZPX is collateral, yield principal, and alignment weight at once, and the contract reconciles the three roles not by trusting its own bookkeeping but by proving, transaction by transaction, that the bookkeeping and the vault agree. This is the protocol's one discipline — compute, do not trust — applied to its own capital (§1).

### 2.1 One equation

Plain: what the contract holds equals what it owes, at all times. Precise: the Master Conservation Identity, in the floor-free form the guard actually enforces —

$$
\mathrm{balance} \;+\; \mathrm{totalDebt} \;+\; \mathrm{totalBadDebt} \;=\; \mathrm{totalStaked} \;+\; \mathrm{rewardReserve} \;+\; \mathrm{protocolReserve} \;+\; \mathrm{pending}
$$

with $\mathrm{pending} = \mathrm{totalRewardDistributed} - \mathrm{totalRewardsPaid}$.

| Term | Side | Meaning |
|---|---|---|
| `balance` | held | Physical BZPX the contract holds right now — a raw `staticcall` on the token, never a ledger variable |
| `totalDebt` | held | Principal lent out: tokens that left the vault against collateral still on the books |
| `totalBadDebt` | held | Recorded losses the protocol reserve could not cover (a liquidation or an exit with stake below debt, or uncollectible interest). Still owed: while it exceeds the dust the protocol reads insolvent until `absorbBadDebt` recapitalises it |
| `totalStaked` | owed | Sum of every position's staked principal |
| `rewardReserve` | owed | Emission funding deposited but not yet distributed |
| `protocolReserve` | owed | Protocol revenue from the 3% reserve factor on interest |
| `pending` | owed | Rewards distributed into the accumulators but not yet transferred out |

Read as a balance sheet: the left side is what the protocol can account for — tokens in the vault, tokens lent out, and losses it has admitted to — and the right side is every claim against it. The arrangement is deliberate: every term sits on the side where it is a plain, individually non-negative state variable, summed without a single `max(x, 0)`. That makes the identity linear over every reachable state, and linearity is what makes it enforceable rather than merely observable, as §2.3 explains.

> FIG. 1 — MCI balance sheet.

### 2.2 The `conserves` guard: solvency as a revert condition

Most protocols treat solvency as something to monitor — a dashboard, an off-chain alert, a health metric an operator watches. BlazePhoenix treats it as something to enforce. Every value-moving entry point — `deposit`, `borrow`, `repay`, `withdraw`, `claimRewards`, `claimPureYield`, `lock`, `liquidate`, `pokeExpiredLock(s)`, `fundEmission`, `withdrawReserve` — is wrapped in a modifier called `conserves`. It snapshots both sides of the identity before the function body runs, re-reads them after, and requires that the two sides moved by the same amount:

$$
\left|\,\Delta\mathrm{lhs} \;-\; \Delta\mathrm{rhs}\,\right| \;\le\; \mathtt{CONSERVATION\_DUST} \;=\; 10^{10}\ \mathrm{wei} \;=\; 10^{-8}\ \mathrm{BZPX}
$$

No transaction can leave the ledger and the vault more than $10^{-8}$ BZPX apart: the `conserves` modifier on every value-moving entry point compares the per-transaction delta of both sides and reverts (`Staking__InvariantBreached`) beyond the dust bound. A transaction that would open a shortfall the books do not show does not get flagged for someone to notice later — it never happens. A hidden shortfall is not monitored; it is unreachable. A realised loss is booked to `totalBadDebt` and counted in owed, so `isSolvent()` reports it until anyone recapitalises it with `absorbBadDebt`.

The guard is framed on the per-transaction *delta*, not the absolute balance, and the choice carries two properties at once:

- **Denial-of-service prevention.** An absolute check (`balance ≥ owed`) could be wedged permanently by history — one wei of rounding drift from months ago, or a donation that raised the balance without raising the ledger, would fail the absolute identity on every subsequent transaction, a denial of service *by* invariant. The delta form cancels historical drift algebraically: only what this transaction did is judged.
- **Leak detection.** Any transaction that moves value in a way the ledger does not reflect — a re-entrancy that claims rewards twice, an accounting path that credits a user without receiving tokens — makes the two sides diverge by exactly the leaked amount, and the transaction reverts atomically, taking the leak with it.

The result is a contract that is not believed solvent but is structurally incapable of *becoming* insolvent through its own operation — the strongest claim a contract can make about itself, and one any reader can re-derive, because the identity is also the contract's public face. Six free views expose it whole: `backing()` returns the physical balance, `owed()` the ledger's claim, `isSolvent()` their comparison, `collateralRatio()` their ratio in WAD (1e18 is exact solvency), `solvency()` a thirteen-field report carrying every term of the identity so any caller can re-derive the equation independently, and `auditInvariants()` a five-bit health mask — conservation, solvency signal, emission cap, accumulator monotonicity, boost boundedness — built for monitors that want one cheap word instead of thirteen. Anyone with a block explorer can check the books without trusting the protocol, its authors, or any dashboard; the trust question is answered not with an audit but with a read.

### 2.3 Why the guard is floor-free

The public `owed()` view floors two of its intermediate subtractions so that it can never report a negative number — the right behaviour for a human-facing solvency readout, and the wrong arithmetic for a guard. Inside a differential check, each floor is a non-linearity: in terminal distress, when interest erosion has consumed the book (§6.6), a legitimate bad-debt liquidation, a repayment, or an interest accrual crosses a floor boundary, the flooring absorbs part of the change on one side only, and a value-preserving transaction reads as a value leak. A guard built on the floored form would revert exactly the recovery tools — liquidate, repay — that the distressed state needs, freezing the book at its worst moment. The guard therefore enforces the floor-free rearrangement above: algebraically the same equation, but with every term placed on the side where it needs no floor, so the identity is linear in every regime and the guard never confuses distress with theft. This is a choice of arithmetic domain, not a patch: a guard must be linear over *every* reachable state, including the distressed states it exists to police, and the dimension in which you write an equation determines the states in which you can enforce it.

### 2.4 What a conservation guard cannot see

There is a lesson here worth stating as a design principle. A conservation guard measures exactly one dimension: totals. A transaction that redistributes value between participants while preserving the total — a misweighted reward share, a stale boost multiplier earning at yesterday's weight, an unfair split of a fixed pot — conserves perfectly and is invisible to the guard by construction. A true invariant is not a sufficient one; *choosing the dimension it measures is the design decision.* The identity's dimension is chosen for the failure class that is fatal and irreversible — the ledger claiming more than the vault holds — and the redistribution class is covered by separate, purpose-built mechanisms: the single-writer rule on the reward denominators (§5.3), the real-time derivation of every boost multiplier (§4.3), and the per-user/global reconciliation of interest charges (§6.6). Each guards the dimension the others cannot.

### 2.5 The breaker, previewed

The identity has one more consequence, treated fully in §12 and previewed here because it completes the thesis: anyone on earth may halt the contract, if and only if they can prove it insolvent. `tripBreaker()` is permissionless but conditional on an objective, un-spoofable on-chain fact — the raw token balance plus dust falling below `owed()` — a condition no caller can assert into existence, because the only direction an outsider can push the balance is upward; donations can prevent the breach, never create it. In a breached emergency, exits are pull-only and scale pro-rata by the physical pot when — and only when — a real shortfall exists (`payout = equity × pot / claims`), a fraction that is exit-order invariant, so there is no advantage to racing the exit queue; in solvent operation the scale factor is at least one and every exit pays full net equity, unchanged. Every emergency event also carries a permanent provenance flag distinguishing the proven path from the discretionary one, so a guardian's judgment call can never later be described as an on-chain proof. Between the guard, the breaker, and the haircut, the same equation is enforced going forward, proven in the present, and settled fairly if it ever breaks from outside.

---

## §3 · The token and the emission schedule

One billion BZPX, fixed forever, as a plain ERC-20: 18 decimals, no mint path, no fee-on-transfer, no rebasing, no transfer hooks, no pause or blacklist — the six deploy invariants recorded in the staking repository, checked against the token bytecode at wiring time. Fully-diluted supply is known from genesis; scarcity is a property of the contract, not a policy. The distribution of the billion across the protocol's allocations is a protocol-level record and lives with the companion paper and the token's own on-chain record; this paper carries the part the engine enforces — the emission budget and its schedule.

**Emission is contract-enforced.** Of the billion, 180,000,000 BZPX are the staking emission, hard-capped as `TOTAL_REWARDS`: `fundEmission` accepts the budget and reverts once cumulative funding reaches the cap — the ceiling is a `require` in the funding path, not a promise in a document. Emission follows a halving schedule: eight periods of two years, sixteen years in all, each releasing half the one before, evaluated as a closed form over the block clock — no stored period index, no keeper, nothing to drift.

| Period (2y each) | Emission (BZPX) | Cumulative (BZPX) |
|---|---|---|
| 1 | 90,000,000 | 90,000,000 |
| 2 | 45,000,000 | 135,000,000 |
| 3 | 22,500,000 | 157,500,000 |
| 4 | 11,250,000 | 168,750,000 |
| 5 | 5,625,000 | 174,375,000 |
| 6 | 2,812,500 | 177,187,500 |
| 7 | 1,406,250 | 178,593,750 |
| 8 | 703,125 | 179,296,875 |

> FIG. 2 — The emission halving schedule: half of the entire budget in the first two years, a sixteen-year tail, and a 703,125-token residue recoverable only to the construction-fixed treasury after the close.

Two consequences a reader deciding today should hold: half of everything is paid in the first two years — arithmetic, not policy — and eight halvings of 180 million sum to 179,296,875, with the 703,125-token residue recoverable only after emission ends, only to the construction-fixed treasury.

---

## §4 · Mandatory locked staking and the boost curve

### 4.1 The lock

Plain: there is no liquid staking — every deposit commits its capital for a chosen term, and the protocol simply honours the term. Precise:

```solidity
deposit(uint256 amount, uint256 lockDays)
```

Every deposit names a lock duration between **90 and 2,555 days** (about seven years), continuous — any day count in the range is valid, not a menu of tiers. Two rules shape the term:

- **The countdown cap.** No lock may outlast the emission programme: `maxLockDaysAvailable()` returns `min(2555, days until emissionEnd)`, a decreasing countdown against the programme's close at year sixteen, and `deposit` reverts on any longer request. There is no point locking past the last second that pays a reward, so the contract refuses to sell you one. For roughly the first nine years the seven-year maximum binds; across the final seven, the countdown does.
- **Extends-only top-ups.** A top-up to an existing position may push the unlock time later, never earlier — enforced in both `deposit` and `lock` — so a position's commitment is monotone: whatever multiplier a lock has earned reflects a term that was genuinely promised and never quietly shortened. New funds joining an existing position inherit its lock, and every deposit settles the position first — pending rewards, pure yield, accrued interest, any lapsed lock — so a top-up can never smuggle new capital into yield computed at a stale weight.

Principal leaves only when two conditions hold together: the lock has expired and the position carries zero debt (`withdraw` reverts with `Staking__HasDebt` otherwise). This is a deliberate inversion of the usual incentive design. Most protocols tax early exit — a penalty percentage, a decay schedule, a slashing curve — and every one of those is a parameter that can be mistuned, gamed at its boundaries, or arbitraged against the yield it guards. BlazePhoenix has no early-withdrawal fee because it has no early withdrawal; there is no penalty schedule to mistune, because the lock is simply honoured. Commitment is enforced by time, not punished by fees. Borrowing remains available throughout — a staker can draw liquidity against locked collateral at any time (§6) — but the stake itself is a one-way commitment until its date.

The mandatory lock is also what keeps the dual-yield accounting of §5 clean. Because a borrower's collateral cannot flee mid-loan, the relationship between a position's stake, its debt, and its boosted weight stays well-defined across the entire life of a loan, and the global accumulators always divide by a denominator built from committed capital — not capital that might exit at the first sign of stress. The lock is not only an incentive instrument; it is a load-bearing assumption of the credit facility built on top of it.

### 4.2 The boost curve

Locking longer earns a larger share of emission, and the schedule of "larger" is a design decision with consequences: a linear boost under-rewards commitment past the early years, while a steep exponential concentrates emission in the longest lockers. BlazePhoenix uses a gentle quadratic in the lock duration $d$, measured in days:

$$
\beta(d) \;=\; 10000 \;+\; 750\cdot\frac{d}{365} \;+\; 250\cdot\left(\frac{d}{365}\right)^{2} \quad \mathrm{[basis points, base } 10000\mathrm{]}
$$

| Lock | Multiplier |
|---|---|
| 90 days | 1.02× |
| 1 year | 1.10× |
| 2 years | 1.25× |
| 4 years | 1.70× |
| 5 years | 2.00× |
| 7 years | 2.75× |

The curve is continuous, not tiered: any day count between 90 and 2,555 is valid, and `boostByDays` evaluates the polynomial in integer arithmetic, floored — a 91st day always buys a little more weight than the 90th, and the flooring, like every division in the contract, rounds against the recipient, never against the pot.

The quadratic coefficient is deliberately a third of the linear one. A purely linear schedule at the same rate would top out near 1.53× at seven years — too little incentive to commit beyond year three — while the mild quadratic term lifts the ceiling to 2.75× without runaway concentration: a maximal locker earns under triple a minimal one. The curve is also scale-free in the sense that matters: the boost multiplies the claimant's *own* share weight in the emission accumulator and dilutes no one's principal, so a small staker's seven-year lock earns exactly the same multiplier as a whale's.

> FIG. 3 — Quadratic boost vs linear.

### 4.3 Boost is the price of illiquidity, and it expires on time

The multiplier is not a loyalty badge; it is compensation for capital the holder *cannot withdraw*. The moment `block.timestamp` reaches `unlockTime`, that capital is liquid again, the effective commitment is zero days, and the honest multiplier is 1.00× — regardless of what stored state still says. The contract enforces this by derivation, not by bookkeeping:

```solidity
function _effectiveLockDays(UserInfo storage u) internal view returns (uint256) {
    if (u.lockDays == 0) return 0;
    return block.timestamp >= u.unlockTime ? 0 : uint256(u.lockDays);
}
```

No code path — present or future — can pay a lapsed commitment at its historical multiplier: every boost in the protocol is derived through `_effectiveLockDays`, which returns zero the instant the unlock passes. The public views agree with the mathematics: `lockInfoOf().boostBps` and `getUserInfo().boostBps` report what a position is *paid* at and read `10000` the moment a lock lapses, while `lockDays` and `unlockTime` continue to report the commitment on record — the view can never flatter a position the maths no longer rewards.

Derivation alone, however, only re-prices a position somebody touches — and an idle staker is, by definition, never touched. The autonomous maintenance sweep therefore carries a second, gas-bounded window over a dedicated registry of live commitments, normalising any lapsed lock it finds: rewards accrued while the commitment was live are settled first, at the weight they were genuinely earned at, and only then is the weight re-written to 1.00× — the correction re-prices the future and never confiscates the past. The two mechanisms are *jointly* necessary: derivation without the sweep would leave an idle position's stale weight sitting in the global denominators, diluting everyone else; the sweep without derivation would leave the stale multiplier readable in the window between expiry and normalisation. Together they make stored state and paid-at weight structurally unable to diverge — and the sweep deliberately does not exempt the transaction's own beneficiary, because releasing your own lapsed weight pays you nothing, so there is no self-dealing to prevent and every transaction is eligible to carry the cleanup, including yours.

### 4.4 The cap and the hold

Two more bounds complete the deposit surface. No wallet can stake more than **30,000,000 BZPX**: `deposit` reverts (`Staking__CapExceeded`) whenever the resulting balance would exceed `MAX_STAKE_PER_WALLET` — enforced at deposit and only at deposit, since borrowing is governed by the LTV and aggregate-utilisation bounds of §6 rather than by the cap, and interest erosion of a capped position can legitimately reopen deposit headroom. Emission is shared pro-rata to boosted stake, so without a cap a single address could capture an arbitrary slice of the fixed budget; the cap makes emission progressive in the only sense enforceable on-chain — it bounds the share any one address can claim.

And no position can withdraw, claim, or re-lock within **ten blocks** of a deposit or of a repayment that clears its debt: `MIN_DEPOSIT_BLOCKS = 10` is an atomicity guard that defeats same-block and same-transaction flash-loan round-trips through the reward accounting, and it is exactly that — a guard against atomicity, not against a patient adversary, who is instead priced by the 90-day minimum lock itself.

---

## §5 · The Dual-Accumulator Doctrine

The Engine pays two distinct yields from two disjoint sources, and a staker earns one or both depending on whether they borrow. This is the subtlest part of the design and the reason one contract can serve savers and borrowers without either subsidising the other. The accounting follows the accumulator pattern proven across DeFi: a global per-share index advances as value arrives, each position stores the index at its last settlement, and pending yield is the difference times the position's weight. Both accumulators advance on the same clock — `_updateGlobal` runs first in every entry point, before any settlement or checkpoint — so no observer, human or contract, can ever read a half-advanced book. What is unusual is the discipline around the two denominators.

The division of labour is exact. A borrower's *effective* stake — stake minus debt — earns emission; a pure staker's *full* stake earns both the emission and the interest stream. Each party is paid for precisely what they contribute: the borrower forgoes yield on the portion of stake they have encumbered but keeps emission on the rest, and the saver, whose capital is what the borrower drew against, collects the interest that borrowing generates. Neither population's yield is funded from the other's source, which is the doctrine's whole content: zero cross-subsidy, enforced by arithmetic rather than by policy.

### 5.1 Emission pays the unencumbered

The first accumulator distributes the emission schedule across **boosted-effective** stake — every position's boost-weighted, *unencumbered* capital:

$$
\mathrm{effective}_i \;=\; \beta_i \cdot (s_i - d_i)
\qquad\qquad
\mathrm{accReward} \;{+}{=}\; \frac{\Delta E \cdot \mathrm{WAD}}{\sum_i \beta_i (s_i - d_i)}
$$

where $\Delta E$ is the emission the halving curve scheduled for the elapsed window. Netting out debt in the weight is a structural statement: a borrower earns emission only on the capital they have not encumbered, so the cost of credit is built into the emission mathematics rather than bolted on as a fee (§6.5 returns to this).

When the denominator is empty — no eligible stake over some window — the engine performs two writes as one: the clock (`lastRewardTime`) advances to the present, and the window's unspent emission stays classed as `rewardReserve`, undistributed. A latecomer who stakes after an empty period captures nothing for it — there is no backlog to farm, because the accumulator never recognised the window — and the stranded emission continues to back the reserve, flowing to future active stakers on schedule. The pairing is deliberate and load-bearing: the two writes are each other's dual — advancing the clock without stranding the value, or stranding the value without advancing the clock, each breaks either the no-backlog property or the conservation identity itself — so the engine commits them together, and the conserves guard holds across the empty window because neither side of the identity moves.

### 5.2 Interest pays the debt-free

The second accumulator is fed not by emission but by the interest borrowers pay, distributed across **boosted-pure** stake — the boost-weighted stake of positions carrying *no debt at all*:

$$
\mathrm{pure}_{i} \;=\; \beta_{i} s_{i}\ \ (d_{i} = 0),\ \ \mathrm{else}\ 0
\qquad\qquad
\mathrm{accPureYield}\;{+}{=}\; \frac{0.97 \cdot I \cdot \mathrm{WAD}}{\sum_{d_{i} = 0} \beta_{i} s_{i}}
$$

where $I$ is the interest collected in the step: 97% flows to the pure population and 3% — the reserve factor — accrues to `protocolReserve`, the protocol's entire revenue from the facility. Collection and distribution move in the same atomic step, so the ledger never claims interest the vault has not received.

The economics are exact. The pure staker is the lender of last resort — theirs is the stake borrowers draw against — and they are paid as one: every unit of pure yield a saver receives is a unit of interest a borrower paid, a closed loop with no external source and no claim of the ledger against itself. And the membership rule should be stated plainly, because it is a cliff, not a slope: **a single wei of debt removes a position from the pure population entirely**, on its full stake, until the debt is cleared. The first wei of borrowing therefore costs far more than the second — it forfeits the whole interest stream, not a marginal slice — which is precisely the intended price signal: borrow deliberately or not at all.

### 5.3 The single writer

Every per-share division above is only as honest as its denominator, so the denominators have exactly one author. `_applyBoost` is the sole function in the contract that writes `totalBoostedEffective` and `totalBoostedPure`: it re-derives both of a position's contributions from current stake, debt, and effective lock, and swaps old weight for new in the global totals atomically, using plain checked arithmetic. No path — not deposit, not liquidation, not lock expiry, not the emergency hatch — may adjust the denominators except through it, which is what guarantees the accumulators always divide by a number that reflects reality. The checked subtraction is itself a tripwire: if a global total ever fell below a single position's tracked contribution, the subtraction would revert — correctly, because that state is impossible under correct operation, and a revert there signals a real bug rather than a denial of service. One writer, one invariant per write, and the redistribution dimension that the conservation guard cannot see (§2.4) is covered at the only place it could go wrong.

One final property runs through every division in this section, and it deserves its own sentence: the rounding always favours the pot. Every division in the contract floors, and the math library contains no rounding-up primitive at all, so the direction cannot be quietly reversed by a later change reaching for a helper. Rewards pay slightly under the exact share; interest charges slightly under the exact amount; the error always runs against whoever would otherwise be over-served. Accumulated rounding can therefore only ever leave the contract holding marginally *more* than it owes — solvency drift is one-directional by construction, a stronger statement than any tolerance band, and the reason the dust bound of §2.2 is a ceiling on noise rather than a budget for loss.

> FIG. 4 — Dual-accumulator flow.

---

## §6 · The credit facility

### 6.1 No oracle, by construction

Lending protocols are broken at the oracle far more often than at the mathematics: a manipulated feed makes sound collateral look worthless — or worthless collateral look sound — and the liquidation logic, however correct, executes on a lie. BlazePhoenix does not harden the oracle; it removes the category. The collateral asset and the borrowed asset are the same token: a staker locks BZPX and borrows BZPX against it, so a position's loan-to-value is a pure ratio of two amounts of one token — debt over stake — and needs no external price to evaluate. There is no feed to manipulate, no TWAP window to game, no update to delay, because there is no price anywhere in the system; the most exploited primitive in decentralised lending is simply not present. What remains is arithmetic over token balances, and that arithmetic is as manipulation-proof as the balances themselves.

### 6.2 The honest ceiling

The headline parameter is a 50% loan-to-value limit, but it is 50% of *effective* stake — stake net of existing debt — and the honest ceiling is smaller than the headline:

$$
d \;\le\; \frac{S - d}{2} \quad\Longrightarrow\quad d \;\le\; \frac{S}{3}
$$

A position can never borrow more than a third of its stake: `borrow()` checks the requested debt against `_ltvCap` on effective stake and reverts (`Staking__LTVExceeded`) beyond it. We print the unflattering number deliberately — the effective-stake base is what makes recursive looping (borrow, restake, borrow again) self-limiting, since each round shrinks the base the next round is measured against, and $S/3$ is the fixed point the recursion converges to rather than a soft target it can spiral past.

### 6.3 The kinked rate — and its true maximum

Interest follows a kinked utilisation curve — the jump-rate model proven across the major lending markets, parametrised for a single-asset book. With aggregate utilisation $U = \mathrm{totalDebt}/\mathrm{totalStaked}$:

$$
U \le U^{*}: \quad r(U) \;=\; R_{0} + U \cdot S_{1} \qquad\qquad U \gt U^{*}: \quad r(U) \;=\; R_{k} + (U - U^{*}) \cdot S_{2}
$$

with $R_{0} = 100$ bps (a 1% APR floor), $R_{k} = 500$ bps at the kink $U^{*} = 80\%$, $S_{1} = 500$ bps, and $S_{2} = 72{,}500$ bps per unit of utilisation.

Below the kink the rate climbs gently from 1% to 5%; above it the steep slope takes over, and at full utilisation the rate reaches its maximum:

$$
r(1) \;=\; 500 + 0.2 \times 72{,}500 \;=\; 15{,}000\ \mathrm{bps} \;=\; \mathbf{150\%\ APR}
$$

The steep branch exists to make the last units of borrowable stake expensive — preserving the withdrawal buffer for stakers and pricing distress as distress — and 150% is its ceiling, not a waypoint: the slope constant $S_2$ is 725% *per unit of utilisation*, but only the final 20% of the range traverses it. The full curve is publicly computable in advance via `simulateRate`, so a borrower can price any hypothetical book state before touching it.

> FIG. 5 — Kinked interest curve (150% at U=1).

### 6.4 The aggregate cap

The per-position bound of §6.2 limits a position; a second bound limits the book. No act of borrowing can push aggregate utilisation past **75%**: `borrow()` computes the post-borrow ratio and reverts (`Staking__UtilTooHigh`) whenever it would exceed `MAX_PROTOCOL_UTIL_WAD`, a ceiling set deliberately *below* the 80% kink. The consequence is structural: the steep branch of the rate curve cannot be entered by anyone's borrowing, however large or well-collateralised — it remains reachable only through interest erosion shrinking the stake base over time, which is exactly the slow-burn scenario the steep branch exists to price. The cap is a property of the aggregate, not a per-account penalty: when any repayment brings utilisation back under 75%, borrowing headroom reopens for every participant simultaneously. Defence in depth, stated plainly — the LTV bound caps what a position can take, the aggregate cap caps what the book can carry, and the steep rates handle the one path neither bound can close.

### 6.5 Interest is self-amortising, and the index is rate-stamped

Interest in this facility does not grow the debt; it shrinks the collateral. An accrued charge is deducted from the borrower's own `staked` balance while the debt principal stays exactly what was borrowed — the position self-amortises — and because the charge never joins the principal, **interest never compounds**: there is no interest on interest, by construction rather than by policy. The borrower's true cost of credit is therefore twofold and fully structural: the stake erosion of the accrual itself, and the forfeited yield of §5 — emission weight computed net of debt, pure yield forfeited entirely. Borrowing pays for itself through the reward mathematics; there is no origination fee, no spread, and no fee schedule to tune, because the cost of credit is not a fee at all. And the interest collected is a transfer, not a surplus: 97% of it is exactly the pure-yield stream of §5.2, so the facility is a closed loop in which every unit a saver receives is a unit a borrower paid, and the ledger never claims against itself. One boundary is stated with the mechanism rather than left implicit: when the pure population's aggregate weight is *residual* — at genesis, or after a book has emptied — dividing the stream by that weight would hand the protocol's entire interest revenue to whatever dust position happened to be the only one present. The distribution is therefore damped by the same floor the emission schedule already uses, and the undamped remainder stays with the reserve instead of concentrating. A pool of dust earns dust, on both channels; the closed loop is unchanged, only its split in a regime no healthy book occupies.

Accrual is driven by a global per-debt index, `accInterestPerDebt`, and the index is kept honest by a strict ordering rule: it is advanced *before* any state write that could move the rate, so each elapsed window is stamped with the rate that actually prevailed across it — no deposit, borrow, or repay can retroactively re-price time that has already passed. Per window:

$$
\delta = \frac{r \cdot \Delta t}{\mathrm{year}}\ \ \mathrm{(index advance, WAD)}, \qquad
\mathrm{slice} = \left\lfloor \frac{\mathrm{totalDebt} \cdot \delta}{\mathrm{WAD}} \right\rfloor\ \ \mathrm{(global debit)}, \qquad
\mathrm{interest}_i = \left\lfloor \frac{d_i \cdot \Delta\mathrm{index}_i}{\mathrm{WAD}} \right\rfloor
$$

The whole book's slice is debited from `totalStaked` in the same step the index advances, and each position is charged its share of the index growth it lived through the next time it is touched — by its own transaction, by the autonomous maintenance sweep that rides every ordinary transaction, or by a liquidator. Lazy per-user settlement is what keeps every operation O(1) regardless of how many borrowers exist, and the rate-stamped index is what makes laziness exact: a position charged after three quiet months pays precisely what it would have paid under continuous accrual, window by window, at each window's true rate. Global debit and per-user charges are thus two views of the same quantity, and keeping them equal in every regime — including the degenerate ones — is the subject of the next section.

### 6.6 Terminal distress, engineered for

Two mechanisms make the accrual arithmetic exact even in the state it will, with sound parameters, never reach — a book eroded to the edge of its own stake. First, the global debit is clamped to what remains (`slice ≤ totalStaked`), and the clamp is only sound if it is *coupled to the index*: the index advance is re-derived from the clamped slice ($\delta = \lfloor \mathrm{slice} \cdot \mathrm{WAD} / \mathrm{totalDebt} \rfloor$) and the debit then re-derived from that floored $\delta$ again, because an uncoupled clamp lets the per-user charges — computed off the unclamped index — sum to more than was globally debited, and a singly-floored one strands rounding dust that is debited globally but attributable to no position, driving `totalStaked` below $\sum_i s_i$ and a later liquidation into a checked underflow. With both re-derivations in place, $\sum_i \mathrm{interest}_i$ equals the global debit in every regime, and the healthy, non-clamped path is bit-identical to the original arithmetic — precision spent only where distress demands it.

Second, when a single position's accrued charge exceeds its remaining stake, the position pays what it has and the uncollectible remainder is reconciled rather than dropped: the shortfall is restored to `totalStaked`, keeping `totalStaked` equal to $\sum_i s_i$ — the equality that the utilisation reading, the solvency views, and the emergency haircut all silently depend on — and it is paid for in the same order as every other loss: first from `protocolReserve`, with only the part the reserve cannot cover recorded in `totalBadDebt`. The floor-free conservation identity of §2.1 is what lets this reclassification pass the guard at all: the shortfall adds to `totalStaked` on the right side, the reserve draw removes its covered part from the right, and the uncovered remainder adds equally to `totalBadDebt` on the left, a lateral move the linear form prices at exactly zero.

### 6.7 Telemetry never understates distress

The published surface is engineered to be honest at the boundary, not just in the interior. If erosion ever drove the stake pool to zero with debt still outstanding, the naive utilisation ratio is undefined — and an instrument that shrugged there would report the terminal state as 0% utilisation and floor rates, maximum distress dressed as perfect health. Instead, the rate function clamps utilisation to 100% and prices the terminal state at the full 150% ceiling, the utilisation and global-stats views saturate rather than reading zero, and `auditInvariants` flags the state — matching `simulateRate`, so no interface reading the published surface can understate the real rate. Distress reads as distress, at every point of the state space including its edge.

### 6.8 Liquidation has a date, not a price

Because debt is fixed at origination (§6.5) and the march toward the threshold is driven only by interest — monotone, priceless, and computable — every position's liquidation is a *date*, published in closed form by `daysToLiquidation`:

$$
s^{*} = \left\lfloor \frac{100\,d}{95} \right\rfloor + 1,
\qquad
\mathrm{days} \;=\; \frac{S - s^{*}}{\;d \cdot r \cdot 1\,\mathrm{day} / \mathrm{year}\;}
$$

where $s^{*}$ is the stake level at which the 95% threshold trips, and the denominator is the daily erosion at the current rate $r$. A debt-free position returns "never"; a position at or past the threshold returns zero; everyone else gets a number of days. Utilisation shifts can move the date — $r$ is the book's current rate — but no market crash can invalidate it, because there is no market price in the system to crash. A borrower can be shown, at the moment of borrowing, the day they would be liquidated if nothing else changed; no oracle-fed protocol can print that sentence.

---

## §7 · Liquidation

### 7.1 The threshold and the waterfall

A position becomes liquidatable when accrued interest has eroded its stake to within 5% of its debt — the guarantee in one sentence: a position can be liquidated exactly when `debt × 100 ≥ stake × 95`, checked identically on the permissionless and the autonomous path, and not one block sooner. The seizure then runs a fixed waterfall:

$$
\mathrm{seized} = \min(d + 0.05\,d,\; s), \qquad
\mathrm{bonus} = \mathrm{seized} - d, \qquad
\mathrm{leftover} = s - \mathrm{seized}
$$

The debt is cleared first; the 5% bonus — capped by the available stake, so it can never invent value the position does not hold — is paid to the liquidator as the incentive that funds keeping the book clean; and any remaining stake stays with the user. The order matters: the protocol is made whole before anyone is rewarded, and the keeper is rewarded before the borrower recovers the remainder.

Concretely: a position carrying 100,000 BZPX of debt trips the threshold when erosion brings its stake to 105,263 BZPX ($100{,}000 \times 100 / 95$). The waterfall seizes $\min(105{,}000,\ 105{,}263) = 105{,}000$: the debt of 100,000 is extinguished, the liquidator collects 5,000, and the remaining 263 BZPX stay with the user. Had erosion run further — stake at 104,000, say — the seizure caps at the full 104,000, the keeper's bonus compresses to 4,000, and the user keeps nothing; the bonus absorbs the squeeze before the debt does.

### 7.2 Bad debt, on the books in plain sight

When stake has fallen below debt — reachable only through extreme, sustained neglect given the maintenance sweep — the shortfall follows a two-stage path: it is absorbed first by `protocolReserve`, the protocol's own accumulated revenue, and whatever the reserve cannot cover is recorded in the public `totalBadDebt` counter and emitted as an event. That counter is not a footnote; it is a term of the Master Conservation Identity itself (§2.1), sitting on the held side of the balance sheet as an acknowledged write-off, so every solvency view reflects the loss from the moment it is booked. No loss is socialised across stakers without first appearing on the protocol's own books, in plain sight, in a variable anyone can read. A booked loss is still owed: `owed()` counts it and never nets it out, so while `totalBadDebt` exceeds the conservation dust `isSolvent()` reads false, and the doors that would pay out of a short pot at par (`deposit`, `borrow`, `withdraw`, `claimRewards`, `claimPureYield`, `withdrawReserve`) revert with `Staking__InvariantBreached`. Anyone may recapitalise the loss through `absorbBadDebt(amount)`: the protocol reserve pays first, then the caller's own tokens, capped at the loss, and the call emits `BadDebtAbsorbed`.

### 7.3 Two paths, one outcome

Liquidation is permissionless: any address may call `liquidate(user)` on an eligible position and collect the bonus. It is also autonomous: the maintenance sweep that rides every ordinary transaction accrues interest on the borrowers in its rotating window, tests the same threshold, and executes the same waterfall — paying the bonus to the transaction's beneficiary, whose gas carried the sweep, with the beneficiary's own position deliberately excluded so no one earns the keeper bonus on themselves. The window self-sizes from pure on-chain state — wider under heavy borrower load, wider after idle gaps, hard-capped at ten positions examined and four written per transaction so worst-case gas is fixed at compile time — which means the protocol never depends on a keeper network existing, only on the book having *any* traffic at all. A dedicated liquidator makes the date of §6.8 arrive promptly; organic flow makes it arrive regardless. On either path, pending rewards are settled before the seizure, so liquidation never confiscates yield already earned — a courtesy the deliberately minimal emergency exit does not extend (§12), and the honest asymmetry between the two doors.

And the end state is worth naming: the liquidated borrower is not ejected. Their debt is cleared, their leftover stake remains staked, and — now debt-free — they rejoin the pure-staker population of §5.2 in the same transaction, earning both emission and the interest stream that other borrowers pay. Liquidation here is not expulsion; it is a forced deleveraging back to the safest seat in the house.

> FIG. 6 — LTV buffer 50→95 as a quantity, not a price.

The figure states the facility's quiet advantage. In an oracle-fed protocol, the gap between a 50% entry LTV and a 95% liquidation threshold is a *price* gap — a number a single candle can erase in one block. Here it is a *quantity*: forty-five points of real stake that only accrued interest can consume, wei by wei, at a public rate, on a computable schedule. The buffer cannot gap down, because nothing in the system moves faster than the clock.

---

## §8 · Autonomous Maintenance

Liquidations must be timely, interest must be accrued, and expired lock boosts must be released — and the industry's usual answer to all three is a fleet of off-chain keeper bots watching the chain. If the bots stop, the book rots. That is a liveness dependency of exactly the kind this protocol refuses everywhere else, so the Staking Engine removes it: the book cleans itself, from the organic flow of ordinary use.

### 8.1 Maintenance rides on every transaction

Every ordinary user action — deposit, borrow, repay, withdraw, claim, lock, or a deliberate poke — finishes by running the maintenance engine, `_autoMaintain`. The engine walks a small, rotating window of tracked positions from a persistent cursor, doing whatever housekeeping those positions are due, and then hands control back to the user's own transaction. Nobody schedules it, nobody is paid a retainer to run it, and nobody can turn it off short of pausing the protocol itself: the maintenance is a side effect of use, funded by the same gas that funds the use.

The consequence is that a busy protocol maintains itself continuously, and a quiet one falls behind only as far as its own quiet warrants — which is the correct trade, because a protocol nobody is touching has, by the same token, nobody racing to exploit its staleness.

### 8.2 The budget is a pure function of on-chain state

How much work one transaction carries is decided by a formula, not an operator. For a registry of length $n$, the probe budget of the next transaction is

$$
\mathrm{budget}(n) \;=\; \min\!\left(\; 1 \;+\; \left\lfloor \frac{n}{50} \right\rfloor \;+\; \left\lfloor \frac{\Delta t_{\mathrm{idle}}}{15\ \mathrm{min}} \right\rfloor,\;\; 10,\;\; n \right)
$$

where $\Delta t_{\mathrm{idle}}$ is the time elapsed since the last sweep. Read it term by term: every transaction scans at least one position; each additional 50 tracked positions add one more; each 15 minutes of idle gap add one more; and the whole thing is clamped at ten so that per-transaction gas is bounded no matter how large the registry grows. The same rule sizes both maintenance windows (`_windowBudget`, applied once per registry), and the lock window carries a second, tighter ceiling of its own: at most four lock normalisations may be *written* per transaction (`MAINT_MAX_LOCK_ACTIONS = 4`), on top of its probe budget. The worst case any user can ever be handed is therefore fixed at compile time — ten examined, four written — unconditionally; what grows with backlog is latency, never the cost of an innocent transaction.

There is no governance parameter and no admin knob anywhere in this formula. It is a pure function of two things the chain already knows — how many positions are tracked, and how long the engine has been idle — so the schedule self-tunes in precisely the two situations that need it: under heavy borrower load the window widens because the registry is long, and after a quiet weekend the first transaction back carries a wider sweep because the gap term has grown. Under light, steady load it contracts to a single probe and costs almost nothing.

### 8.3 Two windows, two jobs

The sweep runs two windows over two registries, because the protocol has two distinct kinds of housekeeping debt.

**Window 1 — solvency.** The borrower registry holds every position with outstanding debt. For each borrower in the window, the engine accrues interest for the elapsed time and checks the liquidation condition; if `debt × 100 ≥ stake × 95` the position is liquidated on the spot, with the seizure surplus paid to the *beneficiary* — the user whose transaction carried the gas — and otherwise the position is poked: rewards settled, lock expiry processed, boost weight resynchronised. The liveness incentive is built into the mechanism itself: whoever's transaction happens to sweep an underwater position collects the 5% liquidation bonus without having asked for the job.

**Window 2 — yield fairness.** The borrower registry is, by construction, blind to a pure staker (`debt == 0`) — and a pure staker whose lock has expired is precisely the position nothing else would ever touch. A second registry, the lockers, tracks every position holding a live lock commitment, and its window normalises any entry whose commitment has elapsed: *settle first* — emission rewards and pure yield are paid at the boosted weight they were genuinely earned at, because everything accrued while the commitment was live was honestly earned — *then release* — the lock is cleared, the weight recomputed at 1.00× through the single boost writer, and the entry de-registered. Only the future is re-priced; the correction never confiscates.

The two windows are budgeted differently because their work differs in kind: a locker *probe* reads two storage slots, while a *normalisation* writes state — so probes rotate under the shared ten-probe cap while writes carry the four-action ceiling, and a probe that finds work does not consume probe budget, because the registry swap-pop holds the cursor in place. A cluster of simultaneous expirations therefore drains several entries per transaction, while a registry with nothing due costs almost nothing to walk past.

> FIG. 7 — The two maintenance windows. Every user transaction sweeps a rotating window of the borrower registry (accrue, then liquidate-or-poke) and of the locker registry (settle, then release), each sized by the same self-tuning budget and hard-capped at ten probes and four lock writes per transaction.

### 8.4 Failure isolation

A sweep that touches other people's positions must never be able to break the transaction that carries it. Each borrower step therefore runs through `maintStep` — an external function callable only by the contract itself — wrapped in `try/catch`: if a single position cannot be processed, that one step is rolled back atomically and skipped, the cursor advances so the sweep never stalls on the same entry, and the innocent user's own transaction still succeeds; the only cost of the isolation is that the poisoned position itself waits for a direct `liquidate` call instead. The lock window uses the same construction (`lockStep`). The scenario this defends is a token-level pathology — a BZPX that refused to pay one specific address could otherwise turn that address into a denial-of-service weapon against everyone whose transactions happened to sweep it — and although BZPX has no such behaviour by construction (§3 states the deploy invariants), the engine does not rely on that: a poisoned position can never DoS an innocent user's transaction, because the failing step is externalised and caught, and the failure mode is bounded to "that one position stays stale."

One further safety property: the engine is disabled entirely while the protocol is paused or in emergency, so a borrower who cannot act to defend their position can never be liquidated by someone else's transaction — the lifeboat and the liquidator are never armed at the same time.

### 8.5 The deliberate asymmetry

The two windows treat the transaction's own sender differently, and the difference is a design decision, not an accident.

The borrower window *skips* the transaction's beneficiary: liquidating your own position would pay you the keeper bonus, and a self-liquidation that profits its subject is an incentive the protocol declines to create. The lock window deliberately does *not* skip the beneficiary — because normalising your own elapsed commitment pays nothing at all; it only releases boost weight the position is no longer entitled to. Had the lock window copied the borrower window's exclusion, an active user could keep an expired boost alive indefinitely *precisely by being the one whose transactions carry the maintenance* — their own traffic would sweep everyone's expiry but their own. The divergence between the two windows is documented in the code at the exact branch where it happens.

### 8.6 Public backstops

Autonomy does not mean exclusivity: everything the engine does opportunistically, anyone may do deliberately. `liquidate(user)` is permissionless and pays the same bonus. `expiredLockScan(offset, limit)` measures the stale-lock backlog on-chain with no indexer — it returns the expired-but-unswept positions in a page along with exactly how much excess weight they still carry on each reward denominator — and `pokeExpiredLock(user)` / `pokeExpiredLocks(users)` let anyone clear that backlog at their own gas cost, feeding the scan's output straight back in. The maintenance engine is the floor of service, not the ceiling.

### 8.7 What "autonomous" claims, precisely

The claim is exactly this: **no privileged actor is required for the protocol to stay healthy** — no keeper fleet, no cron job, no operator, no governance vote. The claim is *not* perpetual motion. With no activity, no maintenance happens; the engine is powered by transactions, and a protocol nobody uses does not need maintaining. Nor is staleness dangerous while it lasts: the worst end state of an unswept backlog is a stale boost weight diluting other stakers' shares — a fairness cost, corrected retroactively-never but prospectively-always at the next sweep — and never insolvency, because a boost is a denominator weight in the reward split, not a claim on value. Solvency is guarded elsewhere, per transaction, by the conservation identity of §2; the maintenance engine's job is timeliness and fairness, and its failure mode is latency.

## §9 · The Verification Surface

A protocol that custodies value should not ask to be believed; it should publish the means to be checked. The Staking Engine turns its own integrity into a set of public, free, on-chain reads, so that any party — a staker, an auditor, a competitor, a sceptic — can confirm in a single `eth_call` that the contract holds what it claims to owe. No dashboard, no subgraph, no indexer, no trust.

### 9.1 Solvency as a public read

The Master Conservation Identity is not hidden inside the implementation; it is surfaced, five ways. `owed()` returns the ledger's total claim — the right-hand side of the identity, recorded bad debt included and never netted out. `backing()` returns the physical BZPX the contract holds, read raw from the token, not from a state variable. `isSolvent()` returns the comparison. `collateralRatio()` returns the ratio in 1e18 fixed point, so a single integer tells the whole story: exactly `1e18` means the contract holds exactly what it owes, anything greater is surplus, and anything smaller is a deficit — a state the `conserves` guard keeps out of reach of any accounting error, which a booked loss shows openly until `absorbBadDebt` recapitalises it, and which, were it ever reached through an external pathology, any address could act on through the permissionless breaker of §12. And `solvency()` returns the full picture in one struct: backing, owed, surplus, deficit, the solvency flag, the ratio, and every term of the identity — `totalStaked`, `totalDebt`, `rewardReserve`, `protocolReserve`, the pending distribution, `totalBadDebt`, and the uncollected-interest telemetry — so a caller can re-derive the equation independently rather than trusting the boolean. None of these takes an argument, consults an oracle, or touches an off-chain service; they are pure reads over the contract's own storage and the token's own balance.

Two details make the surface harder to fool than it looks. First, `backing()` is a raw balance read against the token, not a mirror of any ledger variable — so a divergence between what the contract *has* and what its accounting *believes* is visible by construction, which is the entire point. Second, the ratio is worth reading literally: solvency here is not a quarterly attestation or an operator's dashboard, it is a number on the chain, true at every block, and the same number for every reader — the sceptic and the team query identical state.

### 9.2 The five-invariant audit

Beyond the identity itself, `auditInvariants()` checks five structural invariants at once and packs the result into a single bitmask: zero means every invariant holds, and any set bit localises the violation.

| Bit | Invariant | Meaning |
|---|---|---|
| 0 | Conservation | Mirrors the on-chain breach test: physical backing (plus dust) covers `owed()` right now |
| 1 | Solvency signal | The aggregate book is past the 95% liquidation ratio, or in the terminal state (debt outstanding with the stake pool consumed) — a *soft* early warning, deliberately not part of the revert guard, since a position may be transiently unhealthy pre-liquidation |
| 2 | Emission cap | The reward reserve never exceeds the fixed 180M budget |
| 3 | Accumulator monotonicity | Neither reward accumulator has moved backwards against its audited snapshot — no path rewinds a settled share |
| 4 | Boost bounded | Each boosted denominator stays within `totalStaked × 2.75` (the maximum lock multiplier) — no inflated share exists anywhere |

One call, five equations, and a monitor needs nothing but a node. Bit 0 is the same condition that arms the permissionless breaker, so the mask is not merely diagnostic — a set bit 0 is an invitation any address may accept.

### 9.3 Position views

The same transparency extends to the individual position. `pendingRewards` and `pendingPureYield` quote the two yield streams before claiming, and both route through the *same* internal functions the claim paths use, so the quote and the payment are structurally unable to disagree. `healthFactor` reports distance from liquidation, and `daysToLiquidation` turns it into a date, in closed form:

$$
\mathrm{days} \;=\; \frac{S - S_{\mathrm{liq}}}{D \cdot r \,/\, 365}\,, \qquad S_{\mathrm{liq}} = \frac{100\,D}{95}
$$

— the buffer of stake above the liquidation point, divided by the daily interest burn at the prevailing rate $r$. This is a transparency most lending markets cannot offer even in principle: where collateral has a price, the liquidation point has a price too, and no closed form exists. Here it is arithmetic. The lock views are equally incapable of flattery: `lockInfoOf` and `getUserInfo` report the commitment on record (`lockDays`, `unlockTime`) separately from the multiplier the position is actually *paid* at (`boostBps`), which reads `10000` — 1.00× — the instant an unlock passes, whatever stored state still says; `hasStaleBoost` answers directly whether a position is still carrying weight from an elapsed commitment; and `unlockTime` (in `lockInfoOf` and `getUserInfo`) and `maxLockDaysAvailable` publish the countdown in both directions — when an existing commitment ends, and the longest lock openable *now* given the shrinking distance to the emission close. A prospective staker can even price a decision before making it: `pureStakerApr(lockDays)` quotes an indicative pure-staker rate for any lock duration from the current interest flow, computed by the same arithmetic the accrual uses.

### 9.4 The registries, paginated

Because autonomous maintenance and permissionless liquidation both need to enumerate positions, the registries themselves are public. The borrower set: `activeBorrowerCount`, `isTrackedBorrower`, and `maintenanceBudget` — the size of the window the *next* transaction will sweep. The locker set: `activeLockerCount`, `getLockers(offset, limit)`, `isTrackedLocker`, `lockSweepBudget`, and the `expiredLockScan` of §8.6, which quantifies the stale-boost backlog to the wei. A would-be liquidator, a fairness monitor, or an academic reproducing this paper's claims enumerates everything directly from the chain, with no subgraph and no indexer anywhere in the loop.

### 9.5 The emission, verifiable in closed form

The emission schedule is exposed as arithmetic, not as history. `emittedAt(timestamp)` evaluates the halving curve at any time, past or future, so anyone can verify the schedule for free; dividing `emittedAt(now)` by `TOTAL_REWARDS` gives the released fraction of the 180M budget — tracking the *curve*, not the clock, so it reads 50% at year two and, from the close on, the schedule's final total `TOTAL_REWARDS − (TOTAL_REWARDS >> 8)`, which is 255/256 of the budget. `simulateRate(utilisation)` is a pure function over the whole kinked interest curve, so a reader can recompute the rate at any utilisation and compare it against `currentInterestRateBps` and `getGlobalStats` — and the published telemetry is built to never understate distress: the utilisation views clamp to their honest extreme in the terminal state rather than reporting an undefined ratio as perfect health, so no interface reading the published surface can dress maximum distress as calm. Even the schedule's residue is checkable: eight halvings release 179,296,875 of the 180M budget, and the exact 703,125-token tail is recoverable only to the construction-fixed treasury after the close — a number a reader can confirm from `emittedAt` alone.

### 9.6 The ladder

For a reader deciding how much of this paper to take on faith, the checks come in increasing order of effort, and the first three need no developer skills. **Read the constants:** the lock bounds, the boost coefficients, the LTV and threshold, the emission schedule are named constants near the top of one contract file — search the repository for the name and compare against this paper; one minute. **Check your own history:** every deposit, borrow, repayment, liquidation and claim emits its amounts permanently, so any explorer shows you the exact numbers of your own interactions — the same numbers an adversary would need to prove this paper false. **Ask the contract:** `isSolvent()` — one read, no dashboard to believe — and the full surface of §9.1–9.4 behind it. Then, for the technically inclined: read the source, because the repository — not this paper — is the canonical statement of the design.

## §10 · Economic Security

The Engine's safety rests on arithmetic an adversary cannot bend, not on assumptions an adversary can break. With no oracle and no off-chain dependency, the threat model is unusually small, and each threat that remains is closed by a structural property enforced on every transaction rather than by an operator's vigilance.

### 10.1 The buffer is a quantity, not a price

A position may be opened at a loan-to-value of at most 50% of effective stake and becomes liquidatable only when debt reaches 95% of stake. In an oracle-fed lender the gap between those two numbers is a *price* cushion — and a single candle, a manipulated feed, or a thin-liquidity print can erase it in one block. Here it cannot, because collateral and debt are the same token: the ratio between them contains no price at all, and the only force in the system that moves a position from 50% toward 95% is the accrual of interest against a debt that is fixed the moment it is taken. The buffer is therefore a *quantity* — 45 real percentage points of interest that must actually accumulate, second by second, at a published rate — and no market event of any size can move a position one day closer to liquidation.

The honest ceiling is worth printing plainly: because the 50% cap applies to *effective* stake (stake minus debt), the real maximum debt is a third of stake, not half — an unflattering number the protocol states rather than rounds. And the runway is bounded even in the worst corner of the parameter space: the interest curve tops out at 150% APR at full utilisation — a region that borrowing itself can never create, since `borrow()` refuses any transaction that would push aggregate utilisation past 75% (`Staking__UtilTooHigh`), leaving the steep branch reachable only through slow interest erosion — and even at that maximum a ceiling borrower's stake takes roughly sixteen months to erode from the borrow cap to the liquidation point. At the rates a sub-kink book actually produces, the runway is measured in decades, and §11 walks a concrete case.

> FIG. 8 — The loan-to-value corridor. Borrowing is capped at 50% of effective stake; liquidation triggers at 95% of stake. The corridor between them is a fixed real-terms quantity of accrued interest — there is no price in the system, so there is no price shock that can cross it.

### 10.2 Why borrowing cannot drain the contract

A borrow sends BZPX out of the contract — and in the same atomic step books the same amount as debt, so the two sides of the conservation identity move together and the `conserves` guard, wrapping every value-moving entry point, would revert any version of the flow that leaked so much as `CONSERVATION_DUST` (10¹⁰ wei). The loop is closed at every subsequent step too: interest is a *transfer*, not a surplus — every unit credited to pure stakers (97%) or the reserve (3%) is a unit debited from a borrower's stake, collected and distributed in the same atomic step — so the ledger never claims value the contract has not received. The borrower cannot draw past a third of their own stake; the book cannot be levered past 75%; and the only way to extract more than one's own equity is to let interest carry the position to 95%, where liquidation seizes collateral, clears the debt, and pays the surplus to whoever swept it. There is no sequence of borrows, repays, deposits and withdrawals that leaves the contract holding less than it owes, because every element of every such sequence is checked against the identity before it commits.

### 10.3 The threat model

| Threat | What closes it |
|---|---|
| Oracle manipulation | No oracle exists; collateral, debt and reward are one token. The dominant lending-exploit class is structurally absent, not defended against. |
| Keeper failure / liquidation lag | Autonomous maintenance liquidates from organic flow (§8); permissionless `liquidate(user)` pays a 5% bonus to anyone who acts deliberately. No keeper is required to exist. |
| Admin key compromise | No function reaches staker principal; the admin's only value-moving powers are funding emission (inbound, hard-capped at 180M) and `withdrawReserve`, which is bounded by `protocolReserve` and hard-wired to the treasury address fixed immutably at construction — no destination argument exists. |
| Guardian key compromise | The guardian's strongest power, `declareEmergency`, moves no funds: it halts the protocol and opens every staker's pull-only exit. A hostile guardian can inconvenience; it cannot extract. |
| Flash-loan / same-block attack | A 10-block minimum hold between deposit (or debt-clearing repay) and any withdrawal, claim or lock, plus a per-transaction conservation check no single-block round trip can satisfy while leaking value. |
| Interest-driven insolvency | Interest is a closed-loop transfer (§10.2); the terminal-distress clamp keeps the global debit and the per-position charges equal in every regime, so even a book consumed by erosion stays arithmetically consistent. |
| Backlog capture | Deterministic emission advances its clock over empty intervals; a latecomer cannot claim rewards accrued while no eligible stake existed. |
| Bad debt | Covered first from `protocolReserve`; any remainder is booked to the public `totalBadDebt` counter, which enters the solvency identity directly — no loss is socialised without first appearing on the protocol's own books. |
| Whale capture of emission | A 30M-per-wallet cap, enforced at deposit, bounds any single address's share of the boosted base. (Borrowing is governed by the LTV and aggregate caps instead, and interest erosion can reopen deposit headroom.) |
| Book over-leverage | The 75% aggregate utilisation cap sits deliberately below the 80% kink: no act of borrowing, by anyone, can push the whole book into the steep interest branch. |
| Reentrancy | OpenZeppelin `nonReentrant` on every public entry, checks-effects-interactions ordering on every settlement, and the single-writer boost discipline; a transient claim cannot re-enter to double-settle without breaking the identity and reverting. |

The list is short by design. An invariant-driven contract over a single asset, with no oracle and no keeper, has fewer places to fail — and the places that remain are closed by properties the EVM enforces on every transaction, not by watchfulness that can lapse.

### 10.4 Rounding, and who it favours

Every division in the Engine floors, and the math library contains no rounding-up primitive at all — the direction cannot be quietly reversed by a later change reaching for a helper that does not exist. Rewards pay fractionally under the exact share; interest charges fractionally under the exact amount; the dust always lands on the side of the contract. Accumulated rounding can therefore only ever leave the contract holding *more* than it owes: solvency drift is one-directional by construction, which is a stronger statement than any tolerance band — the per-transaction dust allowance of 10¹⁰ wei exists to absorb this one-sided residue, not to forgive losses.

## §11 · The Lifecycle of a Position

The mechanics of the preceding sections are best understood by following one position through its whole life, with concrete numbers. The global figures in this walkthrough are illustrative — they set the denominators the position's share is computed against — but every constant and every formula is the contract's own, and every number below follows from them.

### 11.1 Deposit and lock

A staker deposits 100,000 BZPX and commits to a two-year lock — 730 days. The boost curve prices the commitment:

$$
\beta(730) \;=\; 10000 \;+\; 750 \cdot \frac{730}{365} \;+\; 250 \cdot \left(\frac{730}{365}\right)^{2} \;=\; 12{,}500\ \mathrm{bps} \;=\; 1.25\times
$$

Debt-free from the first block, the position is a pure staker: it contributes 125,000 units of weight to the boosted-effective base (earning emission on its full stake) and 125,000 to the boosted-pure base (earning the borrower-interest stream as well), and it is registered in the locker registry, where the §8 sweep will eventually find its expiry. Suppose the surrounding book holds 100,000,000 BZPX staked with 25,000,000 borrowed — 25% utilisation, comfortably under the 75% cap — with a boosted-effective base of 90,000,000 and a boosted-pure base of 60,000,000. At 25% utilisation the kinked curve prices borrowing at $100 + 0.25 \times 500 = 225$ bps: 2.25% APR.

### 11.2 The dual yield in numbers

Emission in the first two-year period releases 90,000,000 BZPX — 45,000,000 per year — shared pro-rata over the boosted-effective base. Our staker's share is $125{,}000 / 90{,}000{,}000$, worth about **62,500 BZPX per year** on a 100,000 stake. That figure is a share of a fixed budget, not a promised rate: it is entirely a function of how much competing boosted stake exists, and it halves when the schedule does. On top of it, as a pure staker, the position takes its slice of the interest stream: the book's borrowers pay $25{,}000{,}000 \times 2.25\% = 562{,}500$ BZPX per year, of which 3% accrues to the protocol reserve and 97% — 545,625 — is distributed over the boosted-pure base, worth about **1,137 BZPX per year** at our staker's weight. In the early periods emission dominates; the interest stream is the yield that persists and grows in relative weight as emission halves away.

Two yields, one stake, no cross-subsidy: emission comes from the fixed budget and interest comes from borrowers, the two accumulators fill from disjoint sources, and neither population subsidises the other. A staker chooses a point on the spectrum — pure saver collecting both streams, or borrower trading the interest stream and part of the emission weight for liquidity — and the contract prices both from the same record. The first wei of debt costs far more than the second, because exit from the pure population is a cliff, not a slope.

### 11.3 Borrowing 20,000

At day 90 the staker borrows 20,000 BZPX. The check is oracle-free arithmetic: post-borrow debt must not exceed half of post-borrow effective stake — $20{,}000 \le (100{,}000 - 20{,}000)/2 = 40{,}000$ — within the absolute ceiling of a third of stake (≈ 33,333). The tokens leave the contract and the debt is booked in the same conserved step; the position joins the borrower registry; and its weights re-price instantly through the single writer: boosted-effective falls to $1.25 \times 80{,}000 = 100{,}000$ (emission is earned only on unencumbered stake, so the yearly emission share drops to about 50,000), and boosted-pure falls to **zero** — a single wei of debt exits the pure population entirely. The cost of credit is structural, not a fee schedule: the borrower gives up the interest stream and part of the emission weight for exactly as long as the debt exists.

### 11.4 A liquidation date, not a liquidation price

The 20,000 debt accrues at the prevailing 2.25% — 450 BZPX per year — and that interest is not billed separately but deducted from the borrower's own stake: the position self-amortises, the debt principal never grows, and interest never compounds. Liquidation requires stake to erode to $20{,}000 \times 100/95 \approx 21{,}053$, a buffer of roughly 78,947 BZPX against a daily burn of $450/365 \approx 1.23$ — so `daysToLiquidation` reads a little over **64,000 days: roughly 175 years**. Even if the whole book somehow sat at the curve's 150% APR maximum for the entire time, the same closed form gives about 960 days of runway. The projection moves when utilisation moves the rate — but no market crash can invalidate it, because there is no market price anywhere in the calculation.

### 11.5 Repayment

At day 455, after a year of borrowing, accrued interest has eroded the stake to roughly 99,550. The borrower repays the fixed 20,000 from their wallet; the debt zeroes, the position leaves the borrower registry, and the flash-loan clock restamps — a debt-clearing repayment restarts the 10-block hold before any withdrawal, claim or lock. The weights re-price through the same single writer: $1.25 \times 99{,}550 = 124{,}437.5$ on both bases. The position is a pure staker again, interest stream restored.

### 11.6 Expiry, by a stranger's hand

At day 730 the lock lapses — and the multiplier dies at that instant, not at the next transaction: every boost in the protocol derives through `_effectiveLockDays`, which reads zero the moment `unlockTime` passes, so `boostBps` reports 1.00× immediately and no path can pay the stale 1.25× on anything accrued after expiry. What the *tracked weight* still needs is normalisation, and a stranger provides it: hours later, some unrelated user's deposit carries the §8 lock window across our entry, settles both yield streams at the 1.25× weight they were genuinely earned at through day 730, releases the weight to 99,550 on both bases, and de-registers the position from the locker registry — the stranger pays a few thousand gas and receives nothing, which is exactly why the engine does not wait for volunteers. And if our staker's own transactions are the only traffic, the result is the same: the lock window deliberately does not skip its own beneficiary (§8.5), so the position cannot keep its expired boost alive by being its own maintenance.

### 11.7 Withdrawal

Three conditions gate the exit — debt zero, lock expired, 10-block hold elapsed — and all three now hold. The withdrawal settles both pending yield streams through the same accumulators the claim paths use, removes the position's contributions from the global denominators through the single writer, and transfers the 99,550 BZPX out under the same `conserves` check as every step before it. Deposit, lock, dual yield, credit, self-amortisation, repayment, expiry, exit: one position, one ledger, and the identity held at every line.

> FIG. 9 — Position state machine. A deposit locks and earns as a pure staker; borrowing moves it to the encumbered state (emission only, on unencumbered stake); repayment returns it; crossing 95% liquidates it, with leftover stake returning as a pure position; withdrawal is reachable only with the lock expired and the debt at zero.

## §12 · Emergencies and the Breaker

The lock is not unconditional, and saying otherwise would misstate the guarantee. Two halt paths exist, and they are deliberately unlike each other.

The first is discretionary: a **guardian** may `declareEmergency` for any off-chain reason — a disclosed vulnerability, a token-level incident, anything the chain cannot yet see. It is a power that punishes its holder: declaring moves no funds anywhere, halts the protocol's own operation and revenue, and opens every staker's pull-only exit, so the strongest thing a hostile or compromised guardian can do is give everyone their money back. The emergency is also deliberately distinct from the ordinary pause, and the two should not be conflated. `pause` is the mild instrument — it stops the origination of new risk (deposits, borrows, locks) while leaving repayment, withdrawal and claims open, because a borrower must always be able to de-risk and a staker to leave. Emergency is the terminal one: the entire normal surface closes, including claims, and the hatch opens. Autonomous maintenance is disabled under both, so a borrower who cannot act to defend a position can never be liquidated by someone else's transaction while the halt lasts.

The hatch itself, `emergencyWithdraw`, is pull-only and deliberately simple: it pays net equity — stake minus debt — through a path that does no reward mathematics at all, so a bug anywhere in the complex reward surface cannot trap principal. The price of that simplicity is the one trap a user must know, stated once: rewards unsettled at the moment of exit are **forfeited** — so if you intend to leave through the emergency door and claiming is still available (it is under pause; it is not once emergency is active), claim first. The forfeited amounts remain inside `owed()`, so the post-emergency ledger errs only in the conservative direction: the protocol can look less solvent than it is, never more.

In a *breached* emergency the contract may physically hold less than the sum of net equities, and paying full equity first-come-first-served would hand the pot to the fastest exits. The hatch therefore scales the payout by the physical pot when — and only when — a real shortfall exists:

$$
\mathrm{payout} \;=\; \mathrm{equity} \times \frac{\mathrm{pot}}{\mathrm{claims}} \qquad (\mathrm{pot} \lt \mathrm{claims})
$$

The fraction is exit-order invariant — each exit removes `payout` from the pot and `equity` from the claims, leaving the ratio unchanged for everyone who follows — so there is no advantage to racing the queue; and in solvent operation the scale factor is ≥ 1 and every exit pays full equity exactly as before.

The second halt path trusts no one's judgement: `tripBreaker` is permissionless and succeeds only when the chain itself proves insolvency — physical balance plus dust below `owed()`. The condition is objective and un-spoofable: no address can lower the contract's balance except through flows that lower `owed` in the same conserved step, while donations raise the balance without raising `owed` — so an outsider can *prevent* the condition, never *create* it, and the breaker cannot be tripped maliciously on a healthy contract. The call itself moves nothing; like the guardian's declaration, it only halts and opens exits. The breach then binds in both directions: `cancelEmergency` requires admin and **reverts while the breach still holds**, so operators can lift a halt only by making the contract solvent again — restoring the missing backing — not by declaring it healthy. If a reading was transient, cancellation succeeds the moment the invariant does; trust is removed from the halt decision both ways, since no one can falsely trip it and no one can falsely suppress it.

Every declaration is stamped permanently with its provenance — the event records who tripped it and whether the trigger was permissionless proof or guardian discretion — so a discretionary halt can never later be described as a proven one.

> FIG. 10 — The two halt paths. Guardian discretion and permissionless proof both open the same pull-only hatch; only arithmetic can trip the breaker, and only restored solvency can cancel it.

## §13 · Conclusion

We set out to make solvency a property of the code rather than a claim about it, and the engine this paper specifies is that intent carried to its conclusion. One conservation identity, enforced as a revert condition on every value-moving transaction, makes insolvency through ordinary operation unreachable; a single-asset design removes the oracle that breaks most lenders before it can exist; maintenance rides on ordinary use, bounded in gas, with no keeper anywhere; and the halt of last resort belongs to anyone who can prove, from chain state alone, that it is needed.

What it costs is equally plain. There is no liquid staking: every deposit commits its capital for its term, and the term is honoured, not taxed (§4). The first wei of debt forfeits the entire interest stream, not a marginal slice, because deliberate borrowing is the only kind this design prices (§5.2). And the engine is under construction: the guarantee on offer today is the design itself — every equation re-derivable, every invariant stated with its enforcement site, every limit printed beside its claim — which is exactly the guarantee a reader should demand *before* committing capital to code, not after. The engine ships when the engineering, not the calendar, says so.

The thesis, in one line: **the thing that owes is the thing that proves.** A vault whose balance sheet balances on every transaction or the transaction reverts; an emission schedule, a rate curve and a set of thresholds that nobody — including us — can move, because they are compiled in; and a breaker that no one can trip on a healthy contract and no one can cancel on a breached one. The engine does not ask to be trusted. It is specified so it can be verified — cheaply, publicly, and permanently.

---

## Acknowledgements

Before this engine had a paper, it had hostile readers, and the design is better for every one of them. Our thanks, by name, to the independent researchers who gave the BlazePhoenix source their time, their scepticism and their rigour: NetGakarot, Amit Kumar (`amitbhakar`), AmanDara1, duxun, Thomas, auditor_1b3f2c, llen, siam siddik, destinyae, superagent, Mohd Huzaifa, Raditya, bai bo, Josh W, Borutobro and mohaseenkatika — and to one researcher who chose to remain anonymous and gave their care anyway. A design is a claim, and these people did it the honour of treating it like one.

---

## References

1. samczsun. *So You Want to Use a Price Oracle.* 2020. — The manipulation class this engine removes by construction rather than defends against (§6.1).
2. R. Leshner, G. Hayes. *Compound: The Money Market Protocol.* 2019. — The kinked utilisation-rate family §6.3 parametrises.
3. SushiSwap. *MasterChef.* 2020. — The per-share accumulator pattern the Dual-Accumulator Doctrine builds on (§5).
4. MariaDB Corporation. *Business Source License 1.1.* — The licence this protocol publishes under.

---

## Appendix A · The primitive equations

Every quantitative claim in this paper reduces to one of the following equations. Each is implemented exactly once, at the site named — one definition, no drift. The numbering is stable within this paper: cite them as E1–E9.

| # | Name | Equation | Defined in | § |
|---|---|---|---|---|
| E1 | Master Conservation Identity | $\mathrm{balance} + \mathrm{totalDebt} + \mathrm{totalBadDebt} = \mathrm{totalStaked} + \mathrm{rewardReserve} + \mathrm{protocolReserve} + \mathrm{pending}$ | Staking ledger | §2 |
| E2 | Conservation guard | $\lvert \Delta\mathrm{lhs} - \Delta\mathrm{rhs} \rvert \le 10^{10}\,\mathrm{wei}$ per transaction, else revert | `conserves` modifier | §2 |
| E3 | Boost curve | $\beta(d) = 10{,}000 + 750\,(d/365) + 250\,(d/365)^{2}$ bps | `boostByDays` | §4 |
| E4 | Dual accumulators | $\mathrm{accReward} {+}{=} \frac{\Delta E\cdot\mathrm{WAD}}{\sum \beta_i(s_i-d_i)}, \qquad \mathrm{accPureYield} {+}{=} \frac{0.97\,I\cdot\mathrm{WAD}}{\sum_{d_i=0} \beta_i s_i}$ | `_updateGlobal` | §5 |
| E5 | Kinked rate | $r(U) = 100 + 500\,U$ bps for $U \le 0.8$; $\;500 + 72{,}500\,(U-0.8)$ bps above; $r(1) = 150\%$ | Rate model | §6 |
| E6 | Liquidation waterfall | $\mathrm{seized} = \min(1.05\,d,\; s), \quad \mathrm{bonus} = \mathrm{seized} - d, \quad \mathrm{leftover} = s - \mathrm{seized}$, at $100\,d \ge 95\,s$ | `liquidate` | §7 |
| E7 | Liquidation date | $\mathrm{days} = \frac{S - \lfloor 100\,d/95 \rfloor - 1}{d \cdot r / \mathrm{year}}$ | `daysToLiquidation` | §6.8 |
| E8 | Maintenance budget | $\mathrm{budget}(n) = \min(1 + \lfloor n/50 \rfloor + \lfloor \Delta t_{\mathrm{idle}}/15\,\mathrm{min} \rfloor,\; 10,\; n)$ | Maintenance sweep | §8 |
| E9 | Emergency haircut | $\mathrm{payout} = \mathrm{equity}\cdot\mathrm{pot}/\mathrm{claims}$, applied only under a real shortfall, invariant to exit order | Emergency exit | §12 |

## Appendix B · The invariants

These are the properties that hold in every reachable state — not goals, not monitoring targets: each is enforced by the shape of the code at the site named, and a transaction that would violate an enforced invariant does not execute. Cite them as INV-1–INV-8.

| # | Invariant | Enforcement |
|---|---|---|
| INV-1 | No oracle: no external price feed is an input anywhere in the engine — collateral, debt and reward are one token. | Single-asset design; no feed call exists (§6.1) |
| INV-2 | The lock bounds, the boost coefficients, the LTV and liquidation thresholds, the rate-curve parameters and the emission schedule have no setters in the deployed bytecode. | Compile-time constants (§3, §4, §6, §9.6) |
| INV-3 | Every division in the engine floors; no rounding-up primitive exists in the math library. Accumulated rounding can only leave the contract holding more than it owes. | Library construction (§5.3, §10.4) |
| INV-4 | Every value-moving entry point conserves: held and owed move by equal amounts within 10⁻⁸ BZPX, or the transaction reverts. | `conserves` modifier (E2, §2) |
| INV-5 | Exactly one function writes the global boosted denominators, re-deriving both contributions atomically. | `_applyBoost` single-writer rule (§5.3) |
| INV-6 | A lapsed lock is paid at 1.00× from the instant of expiry: every boost derives through effective lock time, and stored weight is normalised by the sweep — settle first, then release. | `_effectiveLockDays` + lock window (§4.3, §8.3) |
| INV-7 | Debt is fixed at origination; interest is deducted from the borrower's own stake and never compounds; per-position debt ≤ S/3 and aggregate utilisation ≤ 75%. | Borrow checks + self-amortising accrual (§6) |
| INV-8 | The breaker is permissionless and objective: it can be tripped only when balance plus dust falls below `owed()`, and it cannot be cancelled while the breach holds. | `tripBreaker` / `cancelEmergency` (§12) |

Eight invariants, nine equations, one contract. That is the entire trusted surface of the engine — and every row of both tables is checkable against public source.

---

## Glossary

**Autonomous Maintenance** — every ordinary transaction carries a bounded sweep of deferred positions — at most ten examined, four written — so the book stays clean with no keeper; backlog grows latency, never cost. **Atomic** — all or nothing; no state exists in which half a transaction settled. **β(d), the boost curve** — 10000 + 750·(d/365) + 250·(d/365)² bps — 1.02× at the 90-day minimum, 2.00× at five years, 2.75× at seven; scale-free, extends-only. **conserves** — the modifier wrapping every value-moving entry point: held and owed must move by equal amounts, checked as a per-transaction delta within a 10¹⁰-wei dust tolerance, or the transaction reverts. **Dual-Accumulator Doctrine** — two yields from two disjoint sources with zero cross-subsidy: emission pays boosted-effective stake, borrower interest pays boosted-pure stake, each in constant time per interaction. **Master Conservation Identity** — what the contract holds equals what it owes, at all times; not monitored but enforced, per transaction, by `conserves`.
