A healthy loan can never be liquidated.
Integer (uint256) model of NightshiftVault; overflow reverts in Solidity 0.8.
healthy_not_liquidatable · Nightshift/Vault.lean ↗TRANSPARENCY
Every pre-open prediction is stamped on Algorand, every safety rule is a machine-checked proof, and every contract is public. Nothing here depends on trusting Nightshift.
Verified · Formal proofs
Every safety rule below is written as a Lean 4 theorem about Nightshift's own code. Proofs are generated by Harmonic's Aristotle and re-checked by Lean's kernel; a rule shows as verified only once its proof passes.
A healthy loan can never be liquidated.
Integer (uint256) model of NightshiftVault; overflow reverts in Solidity 0.8.
healthy_not_liquidatable · Nightshift/Vault.lean ↗The Vault's health check means exactly: debt is no more than collateral value times the liquidation LTV.
Integer model; floor division as in Solidity.
healthy_iff · Nightshift/Vault.lean ↗A price rise never makes a healthy loan unhealthy.
Integer model.
healthy_mono_price · Nightshift/Vault.lean ↗Adding collateral never makes a healthy loan unhealthy.
Integer model.
healthy_mono_collateral · Nightshift/Vault.lean ↗Repaying debt never makes a healthy loan unhealthy.
Integer model.
healthy_anti_debt · Nightshift/Vault.lean ↗The Vault always rounds in the protocol's favour: a loan it calls healthy is healthy in exact arithmetic too.
Integer model.
healthy_conservative · Nightshift/Vault.lean ↗Liquidation bonuses are capped at 15%.
LLTV at most 100%.
lif_bounds · Nightshift/Vault.lean ↗Anything you can borrow within the Nightshift limit is healthy at that same price.
Integer model; same oracle price at borrow time.
borrowLimit_healthy · Nightshift/Vault.lean ↗The Guardian's sale amount is never negative.
Real-number model; slippage below 100%; position solvent after slippage.
sellAmount_nonneg · Nightshift/Guardian.lean ↗The Guardian never sells more collateral than you have.
Real-number model; slippage below 100%; position solvent after slippage.
sellAmount_le_collateral · Nightshift/Guardian.lean ↗When the Guardian acts, it restores your loan exactly to your target health.
Real-number model (the contract rounds the sale down, so on-chain it can land a hair below target); slippage below 100%; position solvent after slippage.
sellAmount_reaches_target · Nightshift/Guardian.lean ↗The Guardian never sells more than it needs to.
Real-number model; slippage below 100%; position solvent after slippage.
sellAmount_minimal · Nightshift/Guardian.lean ↗If selling can't help, the Guardian won't sell. It alerts you instead.
Real-number model; enforced in the contract, the keeper and the paper Guardian.
no_sell_when_insolvent · Nightshift/Guardian.lean ↗The Guardian only acts on loans that can still be saved by selling.
Real-number model; LLTV below 1 − slippage (true for every Nightshift market).
healthy_gate_solvent · Nightshift/Guardian.lean ↗The fair value always stays between the lowest and highest market signal.
Weights non-negative and summing to 1 (proven by O1a).
blend_within_signals · Nightshift/Oracle.lean ↗The Oracle's signal weights are never negative and always add up to 100%.
Real-number model of the normalisation in computeQuote.
normalize_invariant · Nightshift/Oracle.lean ↗Learning from past accuracy can never produce a negative weight.
Real-number model of learnWeights.
learned_invariant · Nightshift/Oracle.lean ↗With the signals' agreement unchanged, confidence never rises while the market stays closed.
Dispersion held fixed; confidence also depends on how much the signals agree, which can change.
confidence_antitone · Nightshift/Oracle.lean ↗More disagreement between the signals never raises confidence.
Real-number model before rounding.
confidence_antitone_dispersion · Nightshift/Oracle.lean ↗Confidence always stays between 35 and 98.
Real-number model before rounding (rounding keeps the bounds).
confidence_bounds · Nightshift/Oracle.lean ↗Cloak proofs can't be faked through number overflow.
Circuit range checks of 64, 40 and 14 bits; BN254 field.
capacity_fits · Nightshift/Cloak.lean ↗The debt side of the Cloak comparison also stays inside its safe range.
Debt range check of 64 bits; GreaterThan(120).
need_fits · Nightshift/Cloak.lean ↗Inside the circuit's range, field arithmetic equals ordinary arithmetic.
Values below the field modulus.
field_val_eq · Nightshift/Cloak.lean ↗A Cloak proof made from rounded numbers still proves the real loan is solvent.
Collateral rounded down and debt rounded up before proving (as the app now does).
circuit_sound_rounding · Nightshift/Cloak.lean ↗Verified using Harmonic's Aristotle. Manifest generated 2026-10-12 · commit ea1169c · manifest.json
Activity · On-chain
Every flow, counted from the chains themselves: loans, repayments, Guardian rules, Oracle updates, proofs and predictions. Each tile links to its latest transaction.
Ledger · Algorand
Before each opening bell, the Oracle's predictions are written to Algorand, so the track record can't be edited afterwards.
Contracts