Protocol

Maintenance and default

When a position closes before maturity, and what happens when collateral runs out.

Maintenance, checkpoint by checkpoint

Each time settlement applies a checkpoint to a position, it then checks both balances against maintenance margin at that checkpoint's time:

maintenance = max(maintenance floor × N, N × (|K| + shock) × time left ÷ 1 year)
per side, rounded up

If either side is below it, the position closes there with status Closed at maintenance (2). Checkpoints after it are not applied.

Because every checkpoint is replayed in order, the history decides, not the present. A position that fell below maintenance at an hour's spike closes at that hour even if it is settled days later, after funding has come back. Collateral added afterwards cannot rescue it: a top-up settles first, finds the breach, and closes the position before the new USDC would count.

Liquidate

liquidate is the same check sent on purpose. It settles the position through the latest checkpoint and then requires that one side is below maintenance; on a healthy position it fails with Healthy. Anyone can send it. There is no bounty, no auction and no penalty: closing at maintenance moves no money beyond the settled result.

What closing means

A position closed at maintenance has stopped, not been sold. Both sides keep the balances they had after the last checkpoint applied, and each withdraws its own. The side that stayed healthy receives the result up to that checkpoint, not the fixed return it would have had to maturity; to keep the exposure, it has to trade again.

The position's open interest is released from the market and from the venue's cross-maturity total at the same time.

Collateral exhausted

If a checkpoint's result is larger than the losing side's whole balance, the winner receives all of that balance and the position closes as Collateral exhausted (3). The part the loser could not pay is recorded as defaultLoss in the position's SwapEvent and is not owed afterwards.

This is the only loss a position can pass on, and it stays inside the position:

  • there is no insurance fund to draw on;
  • other positions, quotes and markets never pay for it;
  • the winner's unpaid claim is not kept as a debt.

Margin is sized to make it rare: maintenance closes a position while its balance still holds at least a tenth of notional, so collateral runs out only when a single checkpoint moves more than that headroom.

Events

EventWhenFields
SwapEventa position opens, or settles into a new statusswap, market, pnl, paid, defaultLoss, status
OrderEventa quote is posted, filled or cancelledorder, market, maker, notional, fixedRate, status
CheckpointEventa market opens or publishes a checkpointmarket, cumulativeFunding, timestamp, finalized