Liquidation Bots
Bot Owner Action
Build a pause, resume, refund policy or withdrawal transaction for the bot owner
POST
Builds one owner transaction on the bot: pause or resume every trigger, set the refund policy, or withdraw float. Only the bot’s owner wallet can sign it, and Trusset holds no key to the bot. The same transaction from any other wallet reverts.
Actions
pause and resume call setPaused(true) or setPaused(false). A paused bot refuses every trigger on every market, and the markets enabled on it stay enabled.
setRefundPolicy calls setRefundPolicy with both limits, sending 0 for either one omitted. A per-caller cap of 0 disables refunds, and callers then pay their own gas. A refund is the gas the call used plus 40,000 for the refund itself, priced at the lower of the transaction’s gas price and the ceiling. It is limited to what remains of the caller’s cap in that block and to the bot’s balance. A reverted liquidation is never refunded.
withdraw calls withdraw(to, amountWei). The API reads the balance first and refuses with NOTHING_TO_WITHDRAW when it is zero, because the contract would revert. The response discloses the balance and what the transaction will pay at that balance.
Path Parameters
string
required
Bot ID.
Body Parameters
string
required
One of
pause, resume, setRefundPolicy or withdraw. Fields that do not belong to the action are ignored.string
setRefundPolicy. Most wei refunded to one caller within one block, as a string of digits. Defaults to "0", which disables refunds.string
setRefundPolicy. Gas price ceiling for refunds in wei, as a string of digits. Defaults to "0", which means no ceiling.string
withdraw. Wei to withdraw, as a string of digits. Defaults to "0", which withdraws the whole float.string
withdraw. Recipient address. Defaults to the bot’s recorded ownerWallet.Response Fields
object
