Skip to main content
POST
Builds the setAtomicMode transaction on the market’s liquidation router, or confirms it with txHash. The wallet holding DEFAULT_ADMIN_ROLE on the router signs. In atomic mode (1) a liquidation sells the seized collateral to the sale recipient at its standing bid and settles the record in the same transaction, or reverts. In two-step mode (0) seized collateral waits on the router for the sale desk. Every router starts in two-step mode.
In atomic mode a liquidation succeeds only while the sale recipient can buy. Without a live bid, enough allowance and balance, or a fresh price, every liquidation reverts and loans stay liquidatable, also loans the pool is losing money on. Read the state with Get Atomic Sale before switching, and switch back to two-step when the sale recipient stops bidding.

When atomic mode is refused

Switching atomic mode on is refused with 409 ATOMIC_SALE_UNAVAILABLE unless the market’s price source is MARKET and its lender of record declared EXCHANGE_SALE as its realization mode. details.reasonCode is PRICE_SOURCE_NOT_MARKET or REALIZATION_PATH_NOT_EXCHANGE_SALE, with priceSource and realizationMode beside it. When the price source, or the realization path a MARKET market declared, cannot be read, the call answers 503 MARKET_STATE_UNAVAILABLE. Switching back to two-step is never refused on this ground. A router whose implementation predates the atomic sale is refused with 409 ATOMIC_UNSUPPORTED, and details.routerUpgrade carries its upgrade status. The router administrator upgrades it first.

Path Parameters

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

Body Parameters

integer
1 atomic or 0 two-step. Required when building calldata.
string
The router administrator that will sign. Omit it to check your instance’s primary verified wallet. The wallet must hold DEFAULT_ADMIN_ROLE on the router, or the call is refused with ROUTER_ADMIN_ROLE_MISSING.
string
Hash of the mined transaction. Send it to confirm; mode is then read from the router’s AtomicModeSet event. Omit it to receive the calldata.

Response Fields

The calldata response:
object
When the router already runs the requested mode, nothing is built: the answer carries alreadySet: true, mode, modeName, routerAddress and atomic. The confirmed response carries txHash, signedBy, mode and modeName as the transaction set them, currentMode and currentModeName as the router answers now, and routerAddress. The change is written to the audit log as LENDING_ATOMIC_MODE_SET. The calldata example below shortens atomic.

Warnings

Error Codes

Confirming with txHash can also return any transaction verification error.