Skip to main content
POST
Closes a loan whose debt is zero and releases the pledged collateral. In FREEZE markets the tokens are unfrozen in the borrower’s wallet. In CUSTODY markets they are transferred back from the adapter. The endpoint validates loan state on-chain before doing anything, so a loan with any outstanding balance is rejected with a clear reason rather than an opaque revert.

Path Parameters

string
required
Market ID.

Body Parameters

integer
required
On-chain loan ID. Must be a positive integer sent as a JSON number.
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
Interest accrues until the moment of repayment, so a loan repaid with a stale quote almost always carries a small residual balance. DEBT_OUTSTANDING reports the exact remainder. Repay that amount, then close.
A successful close on confirm also marks the Trusset position REPAID with a closedAt timestamp, unless the position was already LIQUIDATED. When txHash is omitted the position is reconciled on the next sync rather than at broadcast.

Errors