On testnet (v2, unaudited)

A fixed sum, paid by contract, if your position is liquidated.

The borrower holds a lending-market position through a cover account that, for the term, refuses borrowing, and withdrawals while in debt. An underwriter locks the cover in full; a recorded liquidation pays it.

Built for Morpho Blue, a lending market that uses a price oracle. On the testnet the cover account runs against a stand-in for the market (a mock), not Morpho Blue itself. No affiliation.

The life of a cover

An underwriter posts an offer.An underwriter posts a standing offer: a premium rate, capacity, pay delay and grace. The capacity is reserved in its vault account; the offer's terms cannot change.
  1. createOfferUnderwriter→CoverOrchestrator
  2. reserveCoverOrchestrator→Vault
  3. opens the offerCoverOrchestrator→PostedOffer

Calls from the specifications, as deployed on the testnet; not audited. Calls open to anyone are drawn on the party most likely to make them. The health ceiling is checked at arming and again at the fill.

Morpho Blue is drawn dashed: a venue outside Gavel, read only, named with no affiliation. On the testnet the adapter runs against a stand-in for it.

Blocks at workVaultPosted offerObligationLien

What each side ends up with

If the position is liquidated.

Borrower is paid the cover, a fixed sum, whatever the liquidation took; the premium was its cost.

Underwriter pays the cover, from its own funds or its locked margin, and keeps the premium.

If it is not liquidated.

Borrower keeps its position, unfrozen once the cover lapses; the premium was the cost of the cover.

Underwriter keeps the premium, and its margin is released.

A worked example

Illustrative, not a quote

One borrower, one underwriter, one market: what each party does, which call it is, and where the money goes. The figures are arithmetic on the assumptions below.

Market. WBTC/USDC on Morpho Blue, liquidation threshold 86%. Its liquidation penalty: 1 / (0.3 × 0.86 + 0.7) − 1 ≈ 4.38%.

Position. 1 BTC of collateral at $150,000; $100,000 borrowed. Liquidatable below $100,000 / 0.86 ≈ $116,279, a little higher as interest accrues.

Cover. $4,380 for three months, the cap: debt × penalty. Premium $500, an assumed figure: each underwriter sets its own rate.

The offer's timing. Pay delay one day, grace one day, shown before purchase.

The assumptions

Market: WBTC/USDC on Morpho Blue, liquidation threshold 86%; its penalty 1 / (0.3 × 0.86 + 0.7) − 1 ≈ 4.38%. Position: 1 BTC at $150,000; $100,000 borrowed; liquidatable below about $116,279. Cover: $4,380 for three months, the cap; premium $500, an assumed figure. Timing: pay delay one day, grace one day.

What happensThe callWho may callWhere the money goes
1The underwriter posts an offer: capacity, premium rate, term, pay delay and grace.CoverOrchestrator.createOfferThe underwriterCapacity reserved in the underwriter's vault account
2The borrower opens a cover account and holds the Morpho Blue position through it.openAccount, supplyCollateral, borrowThe borrower1 BTC in; $100,000 out to the borrower
3The borrower arms the account: from now only repaying and adding collateral are allowed.armThe borrowerNone. Refused above the health ceiling
4The borrower buys $4,380 of cover; the cap and the ceiling are checked, and the policy is written.CoverOrchestrator.insureViaThe borrower$500 premium to the underwriter at once; $4,380 locked under a lien
5BTC falls to $115,000. A liquidator repays the $100,000 debt and takes $104,380 of BTC (0.9077 BTC).The venue's own liquidationAny liquidatorThe borrower keeps 0.0923 BTC ($10,620) and no debt: $4,380 lost to the penalty
6The account records that its collateral fell, reading the venue's record of the position.recordAnyoneNone
7The policy fires and is resolved; $4,380 falls due one pay delay later.Obligation.fire, Obligation.resolveAnyoneNone yet
8aThe underwriter pays by the due date, and the holder redeems the cover's units.Obligation.pay, then Obligation.redeemThe underwriter; the holder$4,380 to the holder
8bOr, unpaid after the due date plus grace: the cover is marked breached, the lien takes the margin, and the holder redeems.Obligation.markBreached, Lien.enforce, then Obligation.redeemAnyone; the holder redeems$4,380 from the locked margin to the holder
  1. 1

    The underwriter posts an offer: capacity, premium rate, term, pay delay and grace.

    The call
    CoverOrchestrator.createOffer
    Who may call
    The underwriter
    Where the money goes
    Capacity reserved in its vault account
  2. 2

    The borrower opens a cover account and holds the position through it.

    The call
    openAccount, supplyCollateral, borrow
    Who may call
    The borrower
    Where the money goes
    1 BTC in; $100,000 out to the borrower
  3. 3

    The borrower arms the account: only repaying and adding collateral are allowed.

    The call
    arm
    Who may call
    The borrower
    Where the money goes
    None. Refused above the health ceiling
  4. 4

    The borrower buys $4,380 of cover; the cap and the ceiling are checked.

    The call
    CoverOrchestrator.insureVia
    Who may call
    The borrower
    Where the money goes
    $500 to the underwriter; $4,380 locked under a lien
  5. 5

    BTC falls to $115,000. A liquidator repays the $100,000 and takes $104,380 of BTC.

    The call
    The venue's own liquidation
    Who may call
    Any liquidator
    Where the money goes
    The borrower keeps 0.0923 BTC ($10,620): $4,380 lost to the penalty
  6. 6

    The account records that its collateral fell.

    The call
    record
    Who may call
    Anyone
    Where the money goes
    None
  7. 7

    The policy fires and is resolved; $4,380 falls due one pay delay later.

    The call
    Obligation.fire, Obligation.resolve
    Who may call
    Anyone
    Where the money goes
    None yet
  8. 8a

    The underwriter pays by the due date; the holder redeems the cover's units.

    The call
    Obligation.pay, then Obligation.redeem
    Who may call
    The underwriter; the holder
    Where the money goes
    $4,380 to the holder
  9. 8b

    Or, unpaid after the due date plus grace: marked breached, the lien takes the margin, the holder redeems.

    The call
    Obligation.markBreached, Lien.enforce, then Obligation.redeem
    Who may call
    Anyone; the holder redeems
    Where the money goes
    $4,380 from the margin to the holder
Result for the borrower
No coverWith cover
Left after liquidation$10,620$15,000
After the $500 premiumAfter the premium$10,620$14,500

The cover returns the penalty. It does not keep the position open: the bitcoin is sold at $115,000 either way.

Other outcomes

No liquidation in the term. The policy lapses (Obligation.lapse); the margin is released (Lien.release, then Lien.claim). The underwriter keeps the $500.

Partial liquidation. The full $4,380 is paid: the account records any fall in its collateral, and the sum is fixed at purchase.

A sharp fall below about $104,400 before anyone liquidates: the borrower's remaining equity, less than $4,380, is lost; the cover still pays $4,380.

Other outcomes

No liquidation in the term: the policy lapses (Obligation.lapse) and the margin is released (Lien.release, then Lien.claim); the underwriter keeps the $500. Partial liquidation: the full $4,380 is paid, the sum being fixed at purchase. A sharp fall below about $104,400 before anyone liquidates: the borrower's remaining equity, less than $4,380, is lost; the cover still pays $4,380.

How it is composed

v2 · on the testnet (Arbitrum Sepolia) · not audited

  • CoverOrchestratorthe underwriter's offers, the premium, the margin under lien, the cover set
  • PostedOfferthe standing offer; one take per policy
  • MorphoCoverAdapterwith its CoverAccount clones: the cover accounts and their freeze; records a fall; answers the cover's trigger. No block of its own
  • Obligationthe cover: the underwriter's contingent obligation, its sum fixed at purchase
  • Liensecures the cover on the margin
  • Vaultholds the capacity, the premium in passing, and the margin
  • Morpho Bluethe venue, read only; on the testnet a stand-in market (MockMorpho, MockOracle, MockIrm)

One cover per arming of an account. The cover's units go to the borrower and can be transferred; the holder is paid.

What it stands on

  • Alongside.Morpho Blue, where a position is liquidated when its health factor, from the market's oracle price, falls below one. No affiliation.

Before you use it

Any fall counts. The account records any fall in its collateral that it did not make itself as the event.

A fixed sum, not the loss. The cover pays the sum bought, at most the penalty on the debt at purchase, whatever the liquidation took.

The account is frozen. For the term, borrowing is refused, and withdrawing collateral is refused while debt remains; repaying and adding collateral stay open.

Not audited. The v2 contracts are on the testnet and unaudited.

Why the sum may differ from the loss

The cover is a fixed sum, chosen at purchase up to a cap: the liquidation penalty on the debt at that moment, at the market's liquidation incentive factor. The penalty actually paid depends on how much debt the liquidator repays, and on interest accrued since. A partial liquidation pays the full sum. A fall so sharp that the collateral is worth less than the debt plus the penalty before anyone liquidates loses the borrower's remaining equity; the cover still pays its sum, no more. The cover does not prevent a liquidation, and changes nothing on the venue.

When the cover pays

The event is recorded when anyone calls record on the account, and each of the account's own actions records first. A liquidation recorded after the window ends is not covered, so recording within it is the holder's burden. Once recorded, anyone may fire the cover and then resolve it. The underwriter owes the sum by the due date: the firing plus the offer's pay delay, or the window's end plus the pay delay if that is earlier. Unpaid by the due date plus the offer's grace, anyone may mark the cover breached and enforce the lien on the margin. Either way, the holder then redeems the cover's units.

When many positions are liquidated at once

A fall in the bitcoin price can liquidate many covered positions together. Each cover is backed by its own margin, the whole sum locked under a lien when it was bought, so one policy's payment does not depend on how many others fire. A market's oracle may read one asset through another: the reference WBTC/USDC market's oracle reads WBTC through bitcoin, so a fall in WBTC against bitcoin liquidates as a price fall would, and covers on that market can fire together. Gavel's contracts read the venue's oracle only to refuse an arming or a fill above the ceiling, never to set the sum.

Go deeper: the cover market · the blocks · the argument