Skip to main content
POST
Builds the transaction that deploys a liquidation bot through the liquidation bot factory. The wallet that signs it becomes the bot’s owner. Broadcast it, then record the bot with Confirm Bot Deployment.
The owner is whichever wallet signs the transaction, not the ownerWallet this call returns. ownerWallet only names the wallet the call expects to sign. Ownership decides who can withdraw the bot’s float, so sign with the wallet that should hold it.

What a liquidation bot does

A liquidation bot is a liquidation shim: a small contract that holds LIQUIDATOR_ROLE on the markets connected to it, so no wallet has to. Its liquidate(market, loanId, signedPrice) is open to any caller. It forwards the call to the lending module, which checks the bot’s role, the price and whether the loan is liquidatable, and reverts otherwise. Seized collateral goes where the market sends it, never to the caller. After a liquidation succeeds, the bot refunds the caller’s gas from its float of the network’s native coin, within the refund policy set with Bot Action. A reverted liquidation pays nothing. A refund transfer that fails is skipped rather than undoing the liquidation. The bot also forwards settleExpiredAuction(market, auctionId). The lending module deployed today has no such function, because its auction module settles expired auctions for any caller, so this path reverts on those markets.

Who calls it

Trusset has no signer and never calls a bot. A liquidation through a bot is a transaction someone else sends: a keeper the operator runs, or any third party. The API builds no calldata for the bot’s liquidate. Liquidate Loan builds a direct market call for a wallet that holds the role itself, so encode the bot call from the bot contract’s ABI.

Who controls it

Only the owner can enable or disable markets on the bot, pause it, set its refund policy and withdraw its float. The factory keeps no role on a bot it deploys, and Trusset holds no key to it. The bot is not upgradeable: replacing one means deploying another and moving the market roles to it. A bot does nothing until it is connected. Connect Bot enables a market on the bot and has the market grant it LIQUIDATOR_ROLE. Fund Bot adds the float that pays refunds.

Body Parameters

string
Wallet expected to sign, returned as ownerWallet. It does not enter the calldata, since the owner is whoever signs. Omit it to name the instance’s registered wallet.

Response Fields

object

Error Codes