> ## Documentation Index
> Fetch the complete documentation index at: https://docs.intention.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Clearinghouse

> The component that stands between every buyer and every seller — novation, margin, and a default waterfall, as protocol code rather than a licensed institution.

A derivatives trade is a promise that outlives the moment it was agreed. Two parties strike a price, and from then until the position closes each is exposed to the other's ability to pay. That exposure, not the price, is the hard part of running a market.

Traditional markets answered it with an institution: the central counterparty, or CCP. The Clearinghouse keeps the function and drops the institution. It is the component that stands between every buyer and every seller — and it is protocol code executing inside the block, not a company you have to be admitted to.

## What a central counterparty is for

Without one, exposure is bilateral. Everyone you trade with is a credit decision you have to make and keep making, and the decisions multiply: `n` participants produce up to `n(n-1)/2` relationships, each with its own terms, its own collateral, and its own opinion of what you are worth. A default does not stay where it started, because the party failing to pay you is failing four others at the same time.

A CCP replaces that mesh with a hub, by a legal step called **novation**. The contract between buyer and seller is discharged and replaced by two contracts: the buyer faces the clearinghouse, and the clearinghouse faces the seller. It becomes the buyer to every seller and the seller to every buyer.

<div className="dg" data-dg="clearinghouse-novation">
  <div className="dg-c" style={{aspectRatio:"720 / 336"}}>
    <svg className="dg-w" viewBox="0 0 720 336" aria-hidden="true">
      <path className="dg-wire dg--orange dg-soft" d="M 151.00 63.00 L 196.00 63.00" />

      <path className="dg-wire dg--orange dg-soft" d="M 151.00 219.00 L 196.00 219.00" />

      <path className="dg-wire dg--orange dg-soft" d="M 57.60 85.00 L 57.60 197.00" />

      <path className="dg-wire dg--orange dg-soft" d="M 104.40 85.00 L 242.60 197.00" />

      <path className="dg-wire dg--orange dg-soft" d="M 242.60 85.00 L 104.40 197.00" />

      <path className="dg-wire dg--orange dg-soft" d="M 289.40 85.00 L 289.40 197.00" />

      <path className="dg-wire dg--blue" d="M 454.00 85.00 L 496.50 109.00" />

      <path className="dg-wire dg--blue" d="M 639.00 85.00 L 596.50 109.00" />

      <path className="dg-wire dg--blue" d="M 454.00 197.00 L 496.50 173.00" />

      <path className="dg-wire dg--blue" d="M 639.00 197.00 L 596.50 173.00" />
    </svg>

    <div className="dg-band" style={{left:"0.0000%",top:"5.3571%",width:"48.1944%",height:"73.2143%"}}><span className="dg-cap">Bilateral — n(n-1)/2 exposures</span></div>
    <div className="dg-band" style={{left:"51.8056%",top:"5.3571%",width:"48.1944%",height:"73.2143%"}}><span className="dg-cap">Novation — n exposures</span></div>
    <div className="dg-b" style={{left:"2.2222%",top:"13.6905%",width:"18.0556%",height:"10.1190%"}}><span className="dg-t">Party A</span></div>
    <div className="dg-b" style={{left:"2.2222%",top:"60.1190%",width:"18.0556%",height:"10.1190%"}}><span className="dg-t">Party C</span></div>
    <div className="dg-b" style={{left:"27.9167%",top:"13.6905%",width:"18.0556%",height:"10.1190%"}}><span className="dg-t">Party B</span></div>
    <div className="dg-b" style={{left:"27.9167%",top:"60.1190%",width:"18.0556%",height:"10.1190%"}}><span className="dg-t">Party D</span></div>
    <div className="dg-b" style={{left:"54.0278%",top:"13.6905%",width:"18.0556%",height:"10.1190%"}}><span className="dg-t">Party A</span></div>
    <div className="dg-b" style={{left:"54.0278%",top:"60.1190%",width:"18.0556%",height:"10.1190%"}}><span className="dg-t">Party C</span></div>
    <div className="dg-b" style={{left:"79.7222%",top:"13.6905%",width:"18.0556%",height:"10.1190%"}}><span className="dg-t">Party B</span></div>
    <div className="dg-b" style={{left:"79.7222%",top:"60.1190%",width:"18.0556%",height:"10.1190%"}}><span className="dg-t">Party D</span></div>
    <div className="dg-b dg--blue" style={{left:"62.0139%",top:"33.9286%",width:"27.7778%",height:"16.0714%"}}><span className="dg-t">Clearinghouse</span></div>
    <div className="dg-free dg-mid" style={{left:"0.0000%",top:"82.7381%",width:"48.1944%"}}><div className="dg-n">Each party is a separate credit decision, and a default does not stay where it started.</div></div>
    <div className="dg-free dg-mid" style={{left:"51.8056%",top:"82.7381%",width:"48.1944%"}}><div className="dg-n">The hub is buyer to every seller and seller to every buyer: one counterparty to assess, one margin rule, one order in which losses are absorbed.</div></div>
  </div>
</div>

Four things follow, and together they are the reason the institution exists at all.

**One counterparty instead of many.** You assess one balance sheet rather than everybody else's, and you assess it once.

**Netting.** Offsetting positions collapse into a single number. That is less collateral to post while the market is calm, and less to unwind when it is not.

**Margin under a published rule.** A hub cannot absorb everyone's risk unless it collects against it, so it takes initial margin up front and variation margin as prices move — under a methodology participants can read in advance and size themselves against.

**A default waterfall.** When someone does fail, the losses are absorbed in a pre-agreed order: the defaulter's own margin, then their contribution to a mutualised fund, then the clearinghouse's own capital, then everyone else's contributions. The order *is* the promise. Knowing it in advance is what lets a member price their exposure to the hub itself.

This is what markets converged on after a century of trying the alternatives, and it works. It is also why a CCP is a systemically important institution rather than a piece of infrastructure.

## What the institution costs

Every one of those four benefits arrives attached to a constraint, and the constraints come from the CCP being a company rather than a mechanism.

| What the CCP gives you        | What being an institution costs                                                                                                                                                                                                                                                          |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| One counterparty              | **Membership.** Clearing is done by clearing members. Everyone else reaches the market through one, inherits that member's risk, and pays for the privilege                                                                                                                              |
| Netting                       | **A ledger you cannot read.** You get a rulebook, a margin methodology, and periodic disclosure. You do not get the positions, and you cannot check the hub's exposure yourself                                                                                                          |
| Margin under a published rule | **A collection lag.** Variation margin is cut at end of day and met the next morning, with intraday calls when a move is large enough to warrant one. Either way an interval separates the price move from the collateral arriving, and across it nothing is posted against the exposure |
| A default waterfall           | **Discretion where it matters most.** Declaring the default, running the auction, tearing up positions — each is a committee decision, taken under pressure, on information the rest of the market does not have                                                                         |

Crypto's two answers so far have both been worse rather than better. A centralized exchange is a CCP that also runs the market and holds the collateral, with none of the supervision and no way to verify the margin it says it holds. Early on-chain venues went the other way and had no clearinghouse at all: bilateral pools, external keepers, and a liquidation that happens if and when somebody finds it profitable to send the transaction.

## The same function, without the institution

Intention takes the CCP's job list and implements it as a component of [kernel execution](/protocol/architecture/kernel).

| The CCP's job              | A traditional clearinghouse                                                                   | The Clearinghouse                                                                                                                           |
| -------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **Novation**               | A legal step applied to the contract after the trade                                          | Structural. A fill produces a position against the protocol; there is never a named counterparty to face                                    |
| **Membership**             | Clearing members, admitted and capitalised. Everyone else clears through one                  | An address. There is no admission step and nothing standing between a trader and the clearinghouse                                          |
| **Margin**                 | Collected against a published methodology, called end of day                                  | Checked in the same block as the fill that moved it, by a pure function anyone can evaluate against a table of inputs                       |
| **The ledger**             | A rulebook and periodic disclosure; positions are private                                     | The chain. Every balance, position, and insurance-fund movement is state, attributed to the transaction that caused it                      |
| **The default waterfall**  | Margin → default fund → CCP capital → mutualised contributions, invoked by a risk committee   | Book → insurance fund → auto-deleveraging, invoked by the protocol at a threshold, in a fixed order, with no discretion available to anyone |
| **Settlement**             | T+1 or later. Until then the guarantee is a promise                                           | The same block execution as the fill. There is no interval in which the promise is outstanding                                              |
| **When absorbers run out** | A resolution process: negotiated tear-ups, cash calls on surviving members, or public support | Auto-deleveraging by a deterministic score computed from public state. The rule is the same at 3am as at noon                               |

One row of that table carries more than the others. In traditional markets the CCP and the institution that keeps the record of who holds what — a central securities depository — are deliberately separate legal entities. You do not want the party bearing counterparty risk to also be the keeper of the book that says who owns what, because a private book held by a single institution leaves nothing to check it against. The separation *is* the check.

The Clearinghouse is both at once. It is the counterparty to every position and the only writer of the record. That merge is safe here for exactly the reason the separation existed: the book is not private. Every balance, position, and insurance-fund movement is public state attributed to the transaction that caused it; the waterfall runs at a threshold with no discretion available to anyone; and the whole cascade commits or aborts as one unit of the block. What institutional separation was buying is bought instead by the ledger being readable.

None of this claims the protocol is safer than a CCP in every respect. A CCP has capital, a supervisor, and a century of default management practice behind it. What it does not have is a ledger anyone can read *while* the default is happening, or a waterfall that runs without a person deciding to run it. Those two are what this design buys, and it buys them by making the clearinghouse a function of the block rather than a party to the trade.

## One writer, and only one

Inside the protocol the Clearinghouse is the only path by which anyone's balance, position, margin, or open interest changes. Settling a fill goes through it. So do liquidation, auto-deleveraging, funding settlement, and margin reservation.

That exclusivity is the design. Modules that hold state — accounts, positions, order books — store data and expose the operations that mutate it, but they do not initiate anything. There is one place where the ledger moves, which means there is one place to audit, one place to instrument, and one place where an invariant can be enforced without hoping every caller remembered it.

## Formulas are separate from effects

The rules that decide *how much* are implemented as pure, stateless functions: margin requirements, liquidation prices, deleveraging selection, fee computation, open-interest limits, and leverage tiers. They take values and return values. They read no ledger state and mutate nothing.

The Clearinghouse calls them and applies the results.

<div className="dg" data-dg="clearinghouse-writer">
  <div className="dg-c" style={{aspectRatio:"720 / 356"}}>
    <svg className="dg-w" viewBox="0 0 720 356" aria-hidden="true">
      <path className="dg-wire dg--blue" d="M 306.00 119.00 L 383.60 119.00" />

      <path className="dg-head dg--blue" d="M 390.00 119.00 L 383.60 123.40 L 383.60 114.60 Z" />

      <path className="dg-wire dg--green" d="M 558.00 226.00 L 558.00 260.00 L 360.00 260.00 L 360.00 271.60" />

      <path className="dg-head dg--green" d="M 360.00 278.00 L 355.60 271.60 L 364.40 271.60 Z" />
    </svg>

    <div className="dg-band" style={{left:"0.0000%",top:"6.7416%",width:"41.6667%",height:"55.0562%"}}><span className="dg-cap">Risk formulas — pure, no writes</span></div>
    <div className="dg-band" style={{left:"55.0000%",top:"6.7416%",width:"45.0000%",height:"55.0562%"}}><span className="dg-cap">Clearinghouse — the only mutator</span></div>
    <div className="dg-b" style={{left:"2.2222%",top:"12.9213%",width:"37.2222%",height:"7.8652%"}}><span className="dg-t">Margin</span></div>
    <div className="dg-b dg--blue" style={{left:"57.2222%",top:"12.9213%",width:"40.5556%",height:"7.8652%"}}><span className="dg-t">Settle fills</span></div>
    <div className="dg-b" style={{left:"2.2222%",top:"22.4719%",width:"37.2222%",height:"7.8652%"}}><span className="dg-t">Liquidation</span></div>
    <div className="dg-b dg--blue" style={{left:"57.2222%",top:"22.4719%",width:"40.5556%",height:"7.8652%"}}><span className="dg-t">Reserve margin</span></div>
    <div className="dg-b" style={{left:"2.2222%",top:"32.0225%",width:"37.2222%",height:"7.8652%"}}><span className="dg-t">Deleveraging selection</span></div>
    <div className="dg-b dg--blue" style={{left:"57.2222%",top:"32.0225%",width:"40.5556%",height:"7.8652%"}}><span className="dg-t">Liquidate</span></div>
    <div className="dg-b" style={{left:"2.2222%",top:"41.5730%",width:"37.2222%",height:"7.8652%"}}><span className="dg-t">Fees</span></div>
    <div className="dg-b dg--blue" style={{left:"57.2222%",top:"41.5730%",width:"40.5556%",height:"7.8652%"}}><span className="dg-t">Deleverage</span></div>
    <div className="dg-b" style={{left:"2.2222%",top:"51.1236%",width:"37.2222%",height:"7.8652%"}}><span className="dg-t">Open-interest limits</span></div>
    <div className="dg-b dg--blue" style={{left:"57.2222%",top:"51.1236%",width:"40.5556%",height:"7.8652%"}}><span className="dg-t">Settle funding</span></div>
    <div className="dg-b dg--green" style={{left:"26.3889%",top:"79.2135%",width:"47.2222%",height:"16.2921%"}}><span className="dg-t">Account · position · open-interest state</span><span className="dg-s">one writer, so a replay cannot diverge</span></div>
    <div className="dg-lbl" style={{left:"48.3333%",top:"33.4270%"}}>values</div>
    <div className="dg-lbl" style={{left:"64.1667%",top:"73.0337%"}}>writes</div>
  </div>
</div>

Two things follow. A margin calculation can be verified in isolation against a table of inputs and expected outputs, with no chain and no state to set up. And because the formulas are bit-exact fixed-point — with rounding fixed at the arithmetic layer rather than per call site — two validators computing the same requirement get the same integer, not the same number to within a tolerance.

<Warning>
  Rounding is part of the specification, not an implementation detail. Margin rounds up where it protects the system; fees floor or ceil according to which side benefits. A node that rounded differently would not be slightly wrong — it would produce a different ledger and fork.
</Warning>

## Margin and reservation

An account's capacity is not just its balance. Resting orders reserve capacity against the position they could open, so an account cannot promise the same collateral to two orders and discover the conflict only when both fill.

Reservation is maintained by the Clearinghouse as orders are placed, amended, cancelled, and filled, and it is re-derived when a position changes underneath resting orders — which is why reduce-only orders resting against a position that has since shrunk are re-evaluated rather than left stale.

Margin is tiered: requirements scale with position size within governance-set bounds, so a position large enough to be hard to unwind carries a proportionally larger requirement. See [Margin modes](/trading/margin-modes) and [Leverage](/trading/leverage) for the trading-side view.

## The default waterfall

This is the CCP mechanism the section above described, with the committee removed. The kernel runs the risk stage in a fixed order before matching, so forced flow is resolved before discretionary flow is admitted.

When an account cannot cover its own losses, the shortfall falls through a fixed sequence of absorbers:

<div className="dg" data-dg="clearinghouse-waterfall">
  <div className="dg-c" style={{aspectRatio:"720 / 428"}}>
    <svg className="dg-w" viewBox="0 0 720 428" aria-hidden="true">
      <path className="dg-wire dg-soft" d="M 224.67 72.00 L 246.27 72.00" />

      <path className="dg-head" d="M 252.67 72.00 L 246.27 76.40 L 246.27 67.60 Z" />

      <path className="dg-wire dg-soft" d="M 467.33 72.00 L 488.93 72.00" />

      <path className="dg-head" d="M 495.33 72.00 L 488.93 76.40 L 488.93 67.60 Z" />

      <path className="dg-wire dg--green dg-soft" d="M 435.00 224.00 L 460.00 224.00 L 460.00 302.00 L 508.60 302.00" />

      <path className="dg-head dg--green" d="M 515.00 302.00 L 508.60 306.40 L 508.60 297.60 Z" />

      <path className="dg-wire dg--green dg-soft" d="M 435.00 302.00 L 460.00 302.00 L 460.00 302.00 L 508.60 302.00" />

      <path className="dg-head dg--green" d="M 515.00 302.00 L 508.60 306.40 L 508.60 297.60 Z" />

      <path className="dg-wire dg--green dg-soft" d="M 435.00 380.00 L 460.00 380.00 L 460.00 302.00 L 508.60 302.00" />

      <path className="dg-head dg--green" d="M 515.00 302.00 L 508.60 306.40 L 508.60 297.60 Z" />

      <path className="dg-wire dg--orange" d="M 215.00 254.00 L 215.00 265.60" />

      <path className="dg-head dg--orange" d="M 215.00 272.00 L 210.60 265.60 L 219.40 265.60 Z" />

      <path className="dg-wire dg--orange" d="M 215.00 332.00 L 215.00 343.60" />

      <path className="dg-head dg--orange" d="M 215.00 350.00 L 210.60 343.60 L 219.40 343.60 Z" />

      <path className="dg-wire dg--orange" d="M 215.00 174.00 L 215.00 187.60" />

      <path className="dg-head dg--orange" d="M 215.00 194.00 L 210.60 187.60 L 219.40 187.60 Z" />
    </svg>

    <div className="dg-band" style={{left:"0.0000%",top:"6.0748%",width:"100.0000%",height:"18.2243%"}}><span className="dg-cap">The risk stage, in fixed order, before matching</span></div>
    <div className="dg-b dg--yellow dg-tight" style={{left:"2.2222%",top:"12.1495%",width:"28.1481%",height:"9.3458%"}}><span className="dg-t">1 · Vault deleveraging</span></div>
    <div className="dg-b dg--yellow dg-tight" style={{left:"35.9259%",top:"12.1495%",width:"28.1481%",height:"9.3458%"}}><span className="dg-t">2 · Liquidation</span></div>
    <div className="dg-b dg--yellow dg-tight" style={{left:"69.6296%",top:"12.1495%",width:"28.1481%",height:"9.3458%"}}><span className="dg-t">3 · Auto-deleveraging</span></div>
    <div className="dg-b dg--orange dg-left" style={{left:"0.0000%",top:"29.9065%",width:"59.7222%",height:"9.8131%"}}><span className="dg-t">An account that cannot cover its own losses</span></div>
    <div className="dg-b dg--yellow" style={{left:"0.0000%",top:"46.2617%",width:"59.7222%",height:"12.1495%"}}><span className="dg-t">Closed against the order book</span><span className="dg-s">bounded by the bankruptcy price</span></div>
    <div className="dg-b dg--orange" style={{left:"0.0000%",top:"64.4860%",width:"59.7222%",height:"12.1495%"}}><span className="dg-t">The insurance fund</span><span className="dg-s">protocol state, funded by liquidation penalties — not a multisig</span></div>
    <div className="dg-b dg--orange" style={{left:"0.0000%",top:"82.7103%",width:"59.7222%",height:"12.1495%"}}><span className="dg-t">Auto-deleveraging opposing positions</span><span className="dg-s">selected by a deterministic score anyone can recompute</span></div>
    <div className="dg-b dg--green" style={{left:"72.2222%",top:"64.4860%",width:"27.7778%",height:"12.1495%"}}><span className="dg-t">Settled</span></div>
    <div className="dg-lbl" style={{left:"45.3889%",top:"61.4486%"}}>shortfall remains</div>
    <div className="dg-lbl" style={{left:"45.3889%",top:"79.6729%"}}>shortfall remains</div>
  </div>
</div>

**Liquidation** is a protocol action. When an account's collateral falls below its maintenance requirement, the network itself closes the position against the book, bounded by the bankruptcy price. There is no keeper transaction, no gas auction, and no race to be the one who triggers it — which removes both the extraction that races produce and the failure mode where nobody shows up during the exact congestion that makes liquidation necessary.

**The insurance fund** is the protocol's equivalent of the mutualised default fund, and it is protocol state: funded by liquidation penalties and drawn on to absorb bankruptcies. It is not a multisig, which means topping it up or drawing from it does not require human signatures during precisely the minutes when human signatures are hardest to collect.

**Auto-deleveraging** is the loss of last resort, used when the book and the insurance fund together cannot absorb a bankruptcy. It occupies the position a CCP fills with tear-ups and cash calls on surviving members — with the difference that opposing positions are closed at the bankruptcy price, selected by a deterministic score computed from public state. Anyone can recompute the selection; nobody chooses it.

See [Liquidations](/trading/liquidations) and [Auto-deleveraging](/trading/adl) for thresholds and worked examples.

## Funding

Funding is sampled continuously and settled on schedule against positions as they stand at settlement, derived from the premium of mark over index and clamped between protocol bounds. Because it runs as a Clearinghouse stage inside block execution, a funding payment is a protocol operation with the same attribution as any other state change — not a periodic sweep by an external process.

See [Funding](/trading/funding) for rates, intervals, and how the premium is computed.

## Why this belongs in the protocol

The alternative — clearing as contracts reacting to a matching engine — creates a window. Between the fill and the margin check, there is a state in which an account is undermargined and something can observe it. Between the trigger and the keeper's transaction, there is a state in which a position should have been liquidated and has not been.

Here the whole cascade — a fill causes a margin check, which triggers a liquidation, which draws on insurance, which may trigger deleveraging, which produces further margin checks — commits or aborts as a single unit of the block. There is no intermediate state in which a breach is observable without the response to it already in flight.

That is the property a CCP promises and cannot deliver, because its guarantee lives in a rulebook and its ledger closes at the end of the day. Here the guarantee is the execution.

## Where to go next

<CardGroup cols={2}>
  <Card title="Matching" href="/protocol/architecture/matching">
    Where the fills the Clearinghouse settles come from.
  </Card>

  <Card title="IntentionKernel" href="/protocol/architecture/kernel">
    The stage order that puts forced flow before discretionary flow.
  </Card>

  <Card title="Liquidations" href="/trading/liquidations">
    Thresholds, the liquidation waterfall, and what a trader sees.
  </Card>

  <Card title="Funding" href="/trading/funding">
    Rates, intervals, and premium computation.
  </Card>
</CardGroup>
