Skip to main content
POST
Builds the transaction that releases escrowed collateral from the custody adapter to its holder, and records the claim once it is mined. This applies to CUSTODY markets only. The adapter returns collateral when a repaid loan closes, when the borrower withdraws collateral, and when a liquidation releases the part it did not seize. The collateral token enforces its own compliance rules on that transfer, so the return can be refused. Typical causes are a holder no longer verified on the token’s register, a frozen address, a compliance module rejection, or a paused token. Rather than reverting the whole operation, the adapter escrows the amount against the holder’s address.
A claim is subject to the same token rules that blocked the original return. While the restriction stands, the claim reverts after the holder has paid gas. When holderAddress is supplied, the token is asked first and a claim it still refuses is answered with 409 COLLATERAL_TRANSFER_RESTRICTED, naming the refusal and who lifts it, instead of calldata. When the token answers none of the transfer checks, or its verdict cannot be read, the claim itself is simulated from holderAddress, and a claim that would revert is refused the same way. The compliance block on Get Loan names what the token currently blocks for the borrower. Lift that restriction first, then claim.
The transaction targets the custody adapter, not the market contract. claimEscrowedCollateral() takes no arguments and pays out the escrow of the wallet that signs it. Signing with any other wallet claims that wallet’s own escrow, or reverts when it has none. holderAddress only decides whose escrow is checked before the calldata is handed back. It does not appear in the transaction and cannot redirect the claim.

Path Parameters

string
required
The market’s record ID, as id on List Markets, not its contract address. See Market IDs. Must be a CUSTODY market.

Body Parameters

string
Address whose escrow is to be claimed, 0x followed by 40 hex characters. When supplied, the adapter’s escrow is read first. An empty escrow is refused with NO_ESCROWED_COLLATERAL, and an escrow the collateral token still refuses to deliver to this address with COLLATERAL_TRANSFER_RESTRICTED, rather than handing back a transaction that reverts once paid for. If the escrow cannot be read, or neither the token’s verdict nor the simulated claim gives an answer, the calldata is still returned; escrowedCollateral is null when the escrow was not read.
string
Hash of the mined claimEscrowedCollateral transaction, 0x followed by 64 hex characters. Send it to confirm the claim and record it. Omit it to receive the calldata. holderAddress stays optional on the confirm: when supplied, the receipt must carry a claim for that address, and only that claim is recorded.

Response Fields

Without txHash the endpoint returns calldata. Send the mined transaction’s hash back as txHash, as confirmWith describes, to record the claim. The confirm reads the adapter’s EscrowedCollateralClaimed event from the receipt rather than the transaction’s target, so a claim sent through a smart-contract wallet (Safe, EIP-7702 or ERC-4337) confirms the same way. Each claim is booked as an ESCROW_CLAIMED row on the holder’s loans on this market that escrowed collateral, oldest escrow first, and appears in the loan’s transactions on Get Position. A transaction already recorded is not booked again. A claim that is never confirmed is still booked. When a loan with escrowed collateral is read through Get Position and the adapter holds less than the escrow on record, the adapter’s claim events for the borrower are read from the chain and booked the same way. Get Escrowed Collateral reads what the adapter still holds.
object
The claim also reverts when the adapter holds less of the collateral token than the escrow records. The escrow entry stays intact on any revert, so the holder can retry once the cause is resolved.

Error Codes

Confirming with txHash can also return any transaction verification error.