Skip to main content
POST
Removes collateral from a loan while leaving it open. The contract reverts if the withdrawal would push the health factor below 1.0, so a loan can only shed collateral it does not need. Single transaction in both modes.

Path Parameters

string
required
Market ID.

Body Parameters

integer
required
On-chain loan ID. A positive integer. Accepted as a JSON number or as a numeric string, so the value Get Loan returns passes straight back.
string
required
Security tokens to release, as a decimal string. Parsed at the collateral token’s decimals.
object
EIP-712 signed price from Sign Price. Omit to price against the stored oracle value.
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.

Response Fields

object
A withdrawal that would breach the health factor, exceed the posted collateral, or target an inactive loan is refused before a transaction is offered, with WOULD_BREACH_HEALTH_FACTOR, INSUFFICIENT_COLLATERAL or LOAN_NOT_ACTIVE. The price is only consulted while the loan still carries debt, so a debt-free withdrawal is never refused for a stale price.
A CUSTODY withdrawal the collateral token refuses does not revert. The adapter escrows the balance instead, so the borrower signs a transaction that confirms and delivers nothing. When that is the case the response carries collateralRelease and warning. Surface them to the borrower before they sign.
Where the released tokens end up depends on the market mode. FREEZE markets unfreeze them in place, so the borrower’s balance does not change but the tokens become transferable again. CUSTODY markets transfer them out of the adapter back to the borrower.

Error Codes