Liquidation & default
A loan that is no longer safe, or no longer paid, can be closed without the borrower. There are three ways, and each leaves any remaining collateral for the borrower to claim.
The lines#
Each market sets three numbers.
| Number | Meaning | Testnet SUI/USDC |
|---|---|---|
| ltv_bps | The most a new loan may borrow against its collateral. | 50.00% |
| liq_bps | The liquidation line. | 75.00% |
| bonus_bps | The extra collateral a liquidator or defaulted lender takes. | 5.00% |
The liquidation line is always at least 20 points above the borrow limit, never above 90%, and the bonus never above 15%. Changes to these numbers take effect only two days after they are proposed.
Testing default and liquidation#
Public loan::grace_ms is 300000. A self-run borrower, an SDK EsseyAgent or an MCP borrower, can take a short-term offer in the same session: post an offer with a short termMs (for example 300000), have that borrower accept it, wait for termMs + 300000, and run the owner's collect-default. A hosted borrower will not take an offer shorter than 6 hours (MIN_HOSTED_TERM_MS, 21600000 ms), so only that path needs a second session after the term and the grace. Liquidation is not on a timer: the live Pyth price has to move the loan through liq_bps (7500 on the testnet markets) at both the spot and the EMA. There is no stand-in price market on this testnet. A healthy loan aborts EHealthy (5). Call POST /v1/borrow/quote or essey_quote before borrowing so an EOverMarketLtv refusal is visible first.
The self-serve API has no liquidate action. A public loan is essey_sui::loan::liquidate or loan::liquidate_pool (SDK Ptb.liquidate). A v2 room is private_room_v2::room::liquidate (SDK liquidateV2Tx, MCP essey_loan_liquidate_v2). The caller passes lenderEnc. An empty value leaves the seized note unscannable; the lender recovers it with recoverRoomNote or essey_shielded_recover.
Liquidation#
Who: anyone. When: the debt is over the liquidation line at the spot price and at the average (EMA) price.
The liquidator pays the whole debt and takes collateral worth the debt plus the bonus, valued at spot and capped at what the loan holds. The rest stays in the loan for the borrower. A healthy loan aborts with EHealthy (5).
Requiring both prices means a brief spike in one does not close a loan the other still calls safe.
Default#
Who: the holder of the loan's LenderClaim. When: five minutes after an offer loan's maturity. During those five minutes the lender cannot collect; the grace equals the price freshness limit, so a repayment decided on any price the protocol still accepts lands first.
The lender takes collateral worth what is owed plus the bonus at a fresh price, capped at what the loan holds; the principal leaves the lender's mandate as on a repayment. Pool loans have no maturity and never default.
For a hosted lender, the LenderClaim sits in your treasury and only your OwnerCap can take it out, so you sign the collection.
Write-off#
Who: anyone. When: the collateral is worth less than the debt at both the spot and the average price.
The payer pays at least the higher of the two collateral values and at most the debt, and takes all the collateral. The lender bears the rest alone; in a pool, the loss lowers the share price.
Claim what is left#
After any of the three, the deed holder takes whatever collateral remains and the deed is spent. A hosted borrower brings it home on its own when auto-claim is on.
Warnings before it happens#
The API warns a borrower when a loan is within 10 points of the liquidation line, when it is liquidatable, when it is due within the hour, and when it is past due. A lender is warned when one of its loans is underwater.