Skip to main content
POST
Builds the router’s sellPending call. It sells all the collateral of an open liquidation record to the sale recipient at its standing bid, and settles the record in the same transaction. Send the hash back to record the sale. It is the atomic sale for a record that is already on the router: one seized in two-step mode, or the remainder of an expired auction. A holder of the router’s OPERATOR_ROLE signs. The sale is priced at the oracle price times the bid. The payment goes through the market’s settlement waterfall like any settlement. It repays the pool, draws on the insurance fund for a shortfall, and returns any surplus to the borrower. The record is recorded as SETTLED with realization: ATOMIC and the sale recipient as buyer.

When a sale is refused

The atomic sale is offered only on a market priced from a live market price (MARKET) whose lender of record declared EXCHANGE_SALE as its realization mode. Any other market is refused with 409 ATOMIC_SALE_UNAVAILABLE, details.reasonCode PRICE_SOURCE_NOT_MARKET or REALIZATION_PATH_NOT_EXCHANGE_SALE, and settles the two-step way through Withdraw Collateral for Sale and Settle Liquidation. When the price source, or the realization path a MARKET market declared, cannot be read, the call answers 503 MARKET_STATE_UNAVAILABLE. The router sells only a whole record. Once any of its collateral left the router for sale, the record is refused with 409 COLLATERAL_ALREADY_OUT_FOR_SALE and settles the two-step way. Before calldata is returned, the API checks that the sale recipient can buy this record. It needs a bid at or above the market’s floor that stays live for at least another 60 seconds, a fresh price, enough allowance and balance for the payment, room under the router’s sale rate limit, and a delivery the collateral token admits. The record’s borrower cannot be the sale recipient. A sale it cannot pay is refused with 409 ATOMIC_BUYER_UNAVAILABLE, details.reasonCode naming the gap and details.expectedPayment the amount. The transaction is then simulated from the signer, and a revert the router would raise is named the same way, with details.revert naming the contract error.

Path Parameters

string
required
Liquidation ID on the market’s router.

Body Parameters

string
The market whose liquidation you mean, as its record ID. Every market runs its own router and IDs restart at 1 on each. Supply it when the same ID exists on several of your markets, or the call is refused with AMBIGUOUS_LIQUIDATION_ID. Also accepted as a query parameter.
string
The router operator that will sign. Omit it to check your instance’s primary verified wallet. A wallet without OPERATOR_ROLE is refused with ROUTER_OPERATOR_ROLE_MISSING, and the error carries the calldata that grants it. Also accepted as a query parameter.
string
Hash of the mined sellPending transaction. Send it to confirm; the sale is read from the router’s AtomicSaleExecuted event and the market’s settlement. Omit it to receive the calldata.

Response Fields

The calldata response:
object
The confirmed response:
object
The sale is written to the audit log as LENDING_PENDING_SOLD_ATOMICALLY.

Error Codes

Confirming with txHash can also return any transaction verification error.