Skip to main content
POST
Closes a liquidation’s record on the router after the market has already settled or written off its own record, when nothing is left to sell or forward. It calls the router’s writeOffLiquidation, which only the router administrator, the holder of DEFAULT_ADMIN_ROLE on the router, may sign. Close is not a settlement. It moves no collateral and no cash, and it books no loss, because the market has already recognized the outcome. It only releases the router’s record, so the router’s count of open records falls and its quiet-state check can pass again. Despite its on-chain name, writeOffLiquidation writes nothing off: the market-side write-off is Handle Liquidation Timeout, and the leg that forwards proceeds is Settle Liquidation.

When It Applies

A router record stays open until something closes it on the router side. When the market’s own record is already closed, the router record collected nothing, and it holds no collateral, there is nothing left to settle. The typical case is a record the router administrator reopened, whose collateral then left the router without a sale being reported. Each condition below must hold, and each is checked before any calldata is built. The second column names the refusal when it does not.
A record this API has marked WRITTEN_OFF is refused with ALREADY_SETTLED, even when its router record is still open. That router record then stays open through this API.

Path Parameters

string
required
Liquidation ID on the market’s router.

Body Parameters

string
Names the market whose liquidation you mean. Every market runs its own liquidation router and IDs restart at 1 on each of them, so the same liquidationId can exist on several markets in one instance. Supply this when it does, otherwise the call is refused with AMBIGUOUS_LIQUIDATION_ID and the response lists the candidates. Also accepted as a query parameter. A value longer than 100 characters is ignored.
string
Hash of the transaction you broadcast for this operation. Send it to confirm the transaction and record the result. Omit it to receive the calldata. A value that is not a 0x-prefixed 64-character hex string is ignored.

Response Fields

object
Confirming moves every open record under this ID on the market to SETTLED. A reopened record keeps the hash of its earlier settlement in settledTxHash.

Error Codes

Confirming with txHash can also return any transaction verification error. A close that reverted on-chain is refused there with TX_REVERTED.