Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

🎯 Deterministic Liquidation

A Vault commits three script leaves at creation: Repayment, Liquidation, and Exit. The Liquidation leaf is spent by the DCN when the Coordination Layer authorizes it for one of two reasons:

  1. Undercollateralization - the live collateral ratio has dropped below the liquidation threshold.
  2. Delinquency - the credit line has reached term without being fully repaid or extended.

Both reasons spend the same Liquidation leaf. Delinquency is a different trigger, not a different script.

<loanPubkey> OP_CHECKSIG

The witness includes a BIP340 signature from a Lin24 threshold session of the DCN. The reason for spending is not encoded in this leaf itself; it is enforced by the Coordination Layer and each signer's local validation policy.

Coordination Layer

A deterministic coordination program - implemented by the core contracts plus the Relayer - tracks Vault collateral, debt, and oracle state.

  • It emits deterministic liquidation instructions (e.g., "fully liquidate position #123 at 90% LTV" or "partially liquidate lot from position #456 for delinquency").
  • It cannot move BTC directly. It only attests that a liquidation condition is satisfied to the DCN.
  • Every state change is verifiable and reproducible across DCN signers.

Per-Signer Validation

Each DCN member independently validates before co-signing. If any rule fails on any signer, the signing session aborts and no signature is produced.

  • Inputs reference the correct Vault UTXO and the correct MAST leaf.
  • Outputs are not controlled by DCN members (the sweep goes to the configured liquidation destination, not to any signer-controlled address).
  • Oracle price data is fresh and within deviation limits.
  • On-chain contract state confirms the position is liquidatable (CR breach or delinquent at term).
  • The Exit leaf's CSV has not expired (if it has, the borrower's Exit path dominates and the DCN must not spend).

These checks run locally on every signer. They are application-layer signing policy, not a property of Lin24 itself. See Key Lifecycle for how this policy interacts with DKG and refresh.

Liquidation Flow — Undercollateralization (90% LTV)

When a position reaches 90% LTV (or breaches the liquidation threshold), Surge performs a full liquidation:

  1. Coordination Layer detects the breach and opens a full liquidation record covering the entire credit line—there are no partial lots.
  2. DCN members reconstruct the PSBT from committed vault parameters and validate locally.
  3. A Lin24 signing session produces the Schnorr witness; the transaction is broadcast to Bitcoin.
  4. Collateral BTC is routed to the DCN-controlled sweep address and a Dutch auction opens on the EVM side against the market that issued the credit line.
  5. Auction proceeds in stablecoin retire the full debt plus the liquidation penalty; the position is closed. Any remaining BTC surplus after settlement is returned to the borrower per market policy.

Delinquency Flow — End-of-term, unpaid

Near term end, the Coordination Layer checks whether the credit line is fully repaid or extended. If not, the delinquency flow activates. Delinquency uses the same Liquidation leaf on Bitcoin, but settlement is a partial liquidation:

  1. Coordination Layer emits a delinquency signal and opens a liquidation record with a lot size—typically a partial sweep sized to cover outstanding debt and penalty without closing the entire position unnecessarily.
  2. DCN members reconstruct the PSBT based on the committed vault parameters.
  3. DCN signs with Lin24 and broadcasts.
  4. BTC is routed to the DCN sweep address; a Dutch auction opens on the EVM side, same as the undercollateralization flow.
  5. Auction proceeds retire the proportional debt and penalty. Any BTC surplus is re-locked into a Vault UTXO under the same three script leaves—the credit line continues with reduced collateral and reduced debt. Further partial liquidations may follow if the position remains delinquent.

The on-chain spend uses the same leaf and signature path as undercollateralization. Only the authorization reason, lot size, and post-auction settlement differ.

Key Guarantees

  • Non-custodial. BTC stays on Bitcoin; the DCN can only spend via quorum signing, and only if per-signer validators accept the authorization reason.
  • Deterministic. PSBT templates and validator rules are reproducible across signers; disagreement aborts signing rather than producing a bad spend.
  • Censorship-safe. If the DCN refuses or disappears, the Exit path lets the borrower recover after the CSV delay.
  • Market-segregated. Auction proceeds reconcile debt in the specific market (variable or fixed-rate) that issued the credit line, not a shared accounting surface.