Skip to main content
POST
Writes off a liquidation the operator was unable to settle. The market clears the outstanding debt, draws on the insurance fund to cover it, and reconciles the pool’s liquidity. The record moves to WRITTEN_OFF. This is a loss-recognition step, not a recovery step. Use it when collateral proved unsellable within the window, or when a sale realised nothing.
Write-off does not touch the liquidation router. The router’s record stays open and whatever collateral it still holds stays there. This API then refuses every further action on the record, because WRITTEN_OFF is terminal here. Withdraw it first with Withdraw Collateral for Sale. Otherwise it is stranded as far as this API is concerned.
On-chain the router’s record remains settleable by its operator, so late proceeds can still reach the market directly. The market applies them to the pool’s loss first and then to what the insurance fund advanced.

Path Parameters

string
required
Liquidation ID on the market’s router. The market-local ID needed on-chain is resolved automatically.

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.
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 0x followed by 64 hex characters is refused with 400 VALIDATION_ERROR and nothing is built or recorded. null or an empty string counts as omitted.

Response Fields

object

The 7 Day Window

The clock starts at the seizure, when the market opened its pending liquidation record. For a liquidation seized straight to the router, that is when the router received the collateral: onChainData.timestamp on Get Pending Liquidations. For the remainder of an expired auction the clock started earlier, at the seizure into the auction. The write-off is possible only once the window has fully elapsed. Calling before then is refused with LIQUIDATION_NOT_TIMED_OUT, and the error carries eligibleAt, the moment after which a retry succeeds.

What the Write-Off Does

1

Close the pending liquidation

The market marks its pending liquidation settled so the debt stops counting against pendingLiquidationDebt.
2

Draw on the insurance fund

The market asks its insurance fund for the record’s whole claim. The fund covers as much as its balance allows, and nothing when it is empty or no longer authorizes the market. What it pays is booked against the record, so later recoveries repay it.
3

Reconcile the pool

Any shortfall between the covered amount and the principal is deducted from pool liquidity. Liquidity providers absorb what the insurance fund could not.
4

Apply held auction cash

Cash the auction venue forwarded for the record, which the market was still holding, counts as late proceeds on the written-off record.
This call requires the signing wallet to hold DEFAULT_ADMIN_ROLE on the market contract, which is a higher privilege than the LIQUIDATOR_ROLE and router OPERATOR_ROLE the other liquidation endpoints need. The role is checked in advance against your instance’s primary verified wallet. A missing role is refused with MARKET_ADMIN_ROLE_MISSING, which carries no grant calldata.

Error Codes

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